>>>>>I'm using PHP with mySQL and I got very weird results when I ran a
count. I used "SELECT COUNT(*) FROM $TableName", with $TableName being my
table's name, for the Query. >>>>>When I printed the result I got "Resource
id #2", what does that even mean. And what did I do wrong?.... 

You tried to print your result object.  Instead do this:

$query = "select count(*) as num from $tablename";
$result=mysql_query($query);
$obj=mysql_fetch_object($result);
$count=$obj->num;
print $count;
Chris




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to