slipperyfish Posted March 26, 2006 Share Posted March 26, 2006 How can I put the result from a count() query into a variable?So far im trying:[code]$totalSQL = "SELECT COUNT(*) FROM feedback"; $tq = mysql_query($totalSQL); $tr = mysql_fetch_array($tq);[/code]and trying to use "$tr" as the variable.. like: [code]print $tr;[/code]but not having much look.. i know there is 12 rows.. however not printing anything.Help appreciated.. Link to comment https://forums.phpfreaks.com/topic/5858-count/ Share on other sites More sharing options...
fenway Posted March 26, 2006 Share Posted March 26, 2006 Try $count = mysql_result( $query, 0, 0 ). Link to comment https://forums.phpfreaks.com/topic/5858-count/#findComment-20953 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.