DONE - Confuse w/ count function? / THANKS
| From: | Naga Sean | Date: | Fri, 30 Mar 2001 21:22:40 +0000 |
| Subject: | DONE - Confuse w/ count function? / THANKS | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-8051@lists.php.net to get a copy of this message | ||
it's working now. Thanks Oson
--- "Oson, Chris M." <CHRIS.M.OSON@saic.com>
> wrote:
>try:
>
>$strSQL = "SELECT COUNT(*) AS 'ItemCount' FROM my_table";
>$result = mysql_query($strSQL, $db);
>list($numberOfItems) = mysql_fetch_array($result);
>
>echo "The number of items in the database is: $numberOfItems\n";
>
>hTH
>
>-----Original Message-----
>From: Naga Sean [mailto:nagasea@kaskus.com]
>Sent: Friday, March 30, 2001 11:59 AM
>To: php-db@lists.php.net
>Subject: [PHP-DB] Confuse w/ count function?
>
>
>I try to use this count function, but no matter how.
>
>I got this result from $t = Resource id #4
>
>
>
>
>
>$t = mysql_query("SELECT COUNT(*) FROM my_table",$db);
>
>echo($t);
>
>
>
>any comments ?
>
>
>
>-naga
>
>
>
>--- Andrei Skorokhod <skorokh1@msu.edu>
>
>> wrote:
>
>>if you just need the number
>
>>
>
>>SELECT COUNT(*) FROM table where ................
>
>>
>
>>At 06:34 PM 3/30/2001 +0100, DC wrote:
>
>>>Hi All
>
>>>I cant quite work out how to count the number of rows in my mysql db that
>
>>>match a certain critieria and the show that number numericaly in my pages.
>
>>>
>
>>>Checked books, php.net etc.
>
>>>
>
>>>Any help is appreciated
>
>>>
>
>>>Yours Dave C
>
>>>
>
>>>
>
>>>
>
>>>--
>
>>>PHP Database Mailing List (http://www.php.net/)
>
>>>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>
>>>For additional commands, e-mail: php-db-help@lists.php.net
>
>>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>>
>
>>
>
>>
>
>>--
>
>>PHP Database Mailing List (http://www.php.net/)
>
>>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>
>>For additional commands, e-mail: php-db-help@lists.php.net
>
>>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>_____________________________________________________________
>www.kaskus.com - FREE EMAIL SERVICE
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
_____________________________________________________________
www.kaskus.com - FREE EMAIL SERVICE