Re: MySQL/PHP problem.
| From: | Curt Zirzow | Date: | Tue, 22 Jul 2003 21:23:19 +0000 |
| Subject: | Re: MySQL/PHP problem. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156339@lists.php.net to get a copy of this message | ||
* Thus wrote Phillip Blancher (phil@ontarioweb.ca):
> I am trying to count in mySQL the number of entries in the field "day" where day=2 or
> 3.
>
> Then I want to check just to see if that returned a value greater than 0 or not.
>
> I am using the code below, but having a problem, I keep getting 0 as the total
>
> What am i doing wrong.
>
>
> $dbqueryshipping1 = "select *, COUNT(day) from tempuserpurchase where
> day=\"2\" and day=\"3\" GROUP BY itemname";
> $resultshipping1 = mysql_db_query($dbname,$dbqueryshipping1);
> if(mysql_error()!=""){echo mysql_error();}
> $shipping1 = mysql_fetch_array($resultshipping1);
try a print_r($shipping1); I'll bet your value is in there just you
arn't accessing it.
It would help if you supplied your code for trying to access your total.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."