Jump to content

mysql_result and count and group by


jonniejoejonson

Recommended Posts

$sql= "SELECT count(*)

FROM name_table

WHERE name='dave'"

GROUP BY state;

$sql_result=$database_object->query($sql);

$sql_result = mysql_query($sql,$connection)

 

$totalNumberOfRows=mysql_result($sql_result, 0);

 

This works fine as long as there is at least 1 result.. how are you meant to get the result of count if the count reult is 0;

Link to comment
https://forums.phpfreaks.com/topic/201945-mysql_result-and-count-and-group-by/
Share on other sites

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.