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.. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 26, 2006 Share Posted March 26, 2006 Try $count = mysql_result( $query, 0, 0 ). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.