zetetic
06-14-2005, 02:55 PM
Last night I was working on making it possible to display the total smilie count on forumhome, and I came up with this code:
$totalsmilies = $DB_site->query("SELECT COUNT(*) FROM smilie");
But when I put $totalsmilies on FORUMHOME I got: "Resource id #62" instead of the number of smilies.
Eventually, I figured out that I had to change it to this...
$totalsmilies = $DB_site->query("SELECT COUNT(*) FROM smilie");
$totalsmilies = mysql_result($totalsmilies,0);
...for it to work. Why did I have to do that and is there a better way?
$totalsmilies = $DB_site->query("SELECT COUNT(*) FROM smilie");
But when I put $totalsmilies on FORUMHOME I got: "Resource id #62" instead of the number of smilies.
Eventually, I figured out that I had to change it to this...
$totalsmilies = $DB_site->query("SELECT COUNT(*) FROM smilie");
$totalsmilies = mysql_result($totalsmilies,0);
...for it to work. Why did I have to do that and is there a better way?