List:General Discussion« Previous MessageNext Message »
From:fabsk Date:January 23 2006 8:42pm
Subject:count(*) send a wrong value
View as plain text  
Hi,

I'm facing a strange problem. I am using a database at my Internet
provider (Free, France). The type of table is MyISAM (no choice), MySQL
4.1.15. I can do my tests with my PHP code or phpMyAdmin.

The definition of my table is:
- uid, int
- cid, int
- response, text
- points, int (can be null)

keys:
- uid, cid
- cid, response(4)
- cid

When I do "select * from my_table where cid=123", I get my 10 records.
But when I do "select count(*) from my_table where cid=123" I get "2". I
also happens with many other values of "cid" and the bad result is
always "2".

I can't understand what's happen. It seems to simple, but there should
be something. Do you have an idea?

Thank you for your attention
Fabien

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