Re: newbY prob
| From: | Kevin Stone | Date: | Wed, 23 Jul 2003 19:48:36 +0000 |
| Subject: | Re: newbY prob | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156514@lists.php.net to get a copy of this message | ||
"Phillip Blancher" <phil@ontarioweb.ca> wrote in message
news:003b01c35151$f2adc0a0$6802a8c0@staff...
Problem with Count.
! am trying to count the number of items in this table. The table has one
field in it.
The code I am using is:
$dbquerymeal = "select COUNT(*) from mealtype";
$resultmeal = mysql_db_query($dbname,$dbqueryshipping1);
if(mysql_error()!=""){echo mysql_error();}
$mealcount = mysql_fetch_row($resultmeal);
echo $mealcount;
The result I am getting is:
Query was empty
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in search.php
Any suggestions?
---------------------------------------------------------------------
Looks like you're not passing the correct variable to the second parameter
in mysql_db_query().
- Kevin