[snip]
I did RTFM...I always RTFM first. That was the example in the F Book!.
Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo

$reccount = @mysql_query("select count(*) from mytable where user =
'testuser');

I try this from mysql and get the correct response ( 1 ).

However, when I put this in an php script, $reccount returns a value of
'Resource id #5'.
[/snip]

Perhaps you did not UTFM or CTFM. But I digress...

$recount at this point is only a handle or resource, you have to do
something with it. You need to change your query a little though...

$reccount = @mysql_query("select count(*) AS recordCount from mytable
where user =
'testuser');

recordCount gives you another handle.

Now you can do ...

$arrRecCount = mysql_fetch_array($reccount);
echo $arrRecCount['recordCount'];

or you can do it differently

$getUser = @mysql_query("select * from mytable where user = 'testuser');
$recCount = mysql_num_rows($getUser);
echo $recCount;

HTH!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to