Jump to content

counting rows in database


jenniferG

Recommended Posts

This is  probably silly, but  in the below script, does $FIND  contain the count

or do I have to do something in addition? The manual  covers just mysql command line

querys.

 

/*

$NOUNITQUERY="SELECT COUNT(*) FROM SISTOCK WHERE CAMERAMODEL='$CAMERAMODEL'";

$FIND= mysql_query($NOUNITQUERY);

*/

 

Thanks,

 

Jennifer

Link to comment
https://forums.phpfreaks.com/topic/74528-counting-rows-in-database/
Share on other sites

$NOUNITQUERY="SELECT COUNT(*) as my_count FROM SISTOCK WHERE CAMERAMODEL='$CAMERAMODEL'";

$FIND= mysql_query($NOUNITQUERY);

$got_it = mysql_fetch_assoc($FIND);

$value_is_here = $got_it[my_count];

 

note: better to use spsecific field rather than *

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.