List:General Discussion« Previous MessageNext Message »
From:Hank Date:January 24 2006 12:52am
Subject:Re: count(*) send a wrong value
View as plain text  
My guess would that your PHP code is not written correctly.

For instance, if you have a query in PHP:

$sql="select * from my_table where cid=123";

...and are using the PHP function mysql_numrows() to count the
results, and then for your next test... you're just changing the query
to:

$sql="select count(*) from my_table where cid=123"

and still using the mysql_numrows()  to get the result, that is your
error.  You'll need to use mysql_result() or some other fetch function
to get the results of the query.

That's my guess.

-Hank
Thread
count(*) send a wrong valuefabsk23 Jan
  • Re: count(*) send a wrong valuemysql23 Jan
    • Re: count(*) send a wrong valueFabien SK23 Jan
    • Re: count(*) send a wrong valuefabsk23 Jan
    • Re: count(*) send a wrong valueMichael Stassen23 Jan
  • Re: count(*) send a wrong valueRhino23 Jan
    • Re: count(*) send a wrong valuefabsk24 Jan
  • Re: count(*) send a wrong valueHank24 Jan
  • Re: count(*) send a wrong valueMartijn Tonies24 Jan
    • Re: count(*) send a wrong valuefabsk24 Jan
      • Re: count(*) send a wrong valueFabien SK24 Jan
        • Re: count(*) send a wrong valueFabien SK24 Jan