Jump to content

Table


user4fun

Recommended Posts

Counting the number of recrods in a table caled ocnfirmed

$q2 = mysql_query("SELECT COUNT(*) FROM confirmed");  	echo $q2;

i dont think it is working, but when it does i want to to sayJoin the group of $q2 people.thanks for any help you can give

Link to comment
Share on other sites

The return value of mysql_query is a database result object, not a field value.

$q2 = mysql_query("SELECT COUNT(*) FROM confirmed");  $row = mysql_fetch_array($q2);echo $row[0];

$q2 = mysql_query("SELECT COUNT(*) AS num FROM confirmed");  $row = mysql_fetch_assoc($q2);echo $row['num'];

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...