List:General Discussion« Previous MessageNext Message »
From:DaWiz Date:September 10 2008 7:02am
Subject:Fw: Weird problem with mysql_query
View as plain text  

>
> ----- Original Message ----- 
> From: "Darryle Steplight" <dsteplight@stripped>
> To: "MySql" <mysql@stripped>
> Cc: <mysql@stripped>
> Sent: Tuesday, September 09, 2008 6:59 PM
> Subject: Re: Weird problem with mysql_query
>
>
>> Hi G,
>>   There is nothing weird about your results. When you do a Count(*)
>> without a GROUP BY(someColumn) you are essentially asking MySQL how
>> many rows are present in the table. But when you do use Group By
>> someColum , you are asking MySql how many  rows do I have of
>> "someColumn" .  It's just a good practice to use GROUP BY when you
>> want to a count of a specific column .
>>
>> mysql> select count(*) as 'Count' from logins GROUP BY dawiz
>>
 I found my problem - it turned out to be a misconception on my part; I was
 using sprintf(buf,"%d", row[i]) if it was a numeric field - this was
 printing the address rather than the value.  Apparently even though the 
data
 is type MYSQL_TYPE_LONGLONG it should be treated as char.

 G Vaughn

Thread
Fw: Weird problem with mysql_queryDaWiz10 Sep