lavazza

msg:4143781 | 2:26 am on May 30, 2010 (gmt 0) |
Instead of: SELECT * FROM uniquehits where date = '$time' And Hits > 2 ORDER BY date Try: SELECT * FROM uniquehits where date = '$time' And Hits > 2 ORDER BY Hits
|
chrissim

msg:4143782 | 2:28 am on May 30, 2010 (gmt 0) |
hi, Yes it did tried that before but it doesn't work and worst still the highest hits like abc.com 260 29-05-2010 was not retrieve at all
|
lavazza

msg:4143783 | 2:40 am on May 30, 2010 (gmt 0) |
I can't guess what that means... Do you get an error message? Do you get a <BLANK> space where you expect to see query results? ------- What happens if you try SELECT Hits FROM uniquehits where date = '$time' And Hits > 2; ?
|
chrissim

msg:4143784 | 2:42 am on May 30, 2010 (gmt 0) |
it can retrieve data but not in order from highest to lower hits
|
lavazza

msg:4143785 | 2:49 am on May 30, 2010 (gmt 0) |
In creating the uniquehits table, have you explicitly declared the data_type for Hits as an integer?
|
chrissim

msg:4143786 | 2:51 am on May 30, 2010 (gmt 0) |
yes that's right, table hits created as INT(11) UNSIGNED NOT NULL DEFAULT 0
|
Tommybs

msg:4143837 | 7:58 am on May 30, 2010 (gmt 0) |
Have you tried select * from uniquehits where `hits` > 2 order by `hits` DESC
|
chrissim

msg:4143838 | 8:33 am on May 30, 2010 (gmt 0) |
hi Tommybs, i did tried the query as you suggested but i still can't get the correct order that i want. The fact that if i ignored the date = $time in my select query it will list all the hits that generate from my previous date.The main point i just want them to retrieve based on my today date in right order from highest to lowest hits
|
Tommybs

msg:4143841 | 8:45 am on May 30, 2010 (gmt 0) |
select * from uniquehits where `hits` > 2 AND `date` = '$time' order by `hits` DESC
|
Tommybs

msg:4143846 | 8:47 am on May 30, 2010 (gmt 0) |
Just out of curiosity have you tried running the query in phpmyadmin or something similar actually replacing the $time variable with an actual value to check that, that is working. I can't see anything obviously wrong but it's always best to eliminate all possibilites
|
lavazza

msg:4143847 | 8:48 am on May 30, 2010 (gmt 0) |
What do you get from echo '<p> My time is: ' . $time . '</p>' ; ?
|
chrissim

msg:4143853 | 9:04 am on May 30, 2010 (gmt 0) |
hi lavazza Echo as My time is: 30-05-2010
|
chrissim

msg:4143854 | 9:10 am on May 30, 2010 (gmt 0) |
hi Tommybs Yeah ...my man that's work great :) Everything turned out in right order from highest to lowest hits. Thanks man and everyones who give me support to my issue here
select * from uniquehits where `hits` > 2 AND `date` = '$time' order by `hits` DESC
|
topr8

msg:4143990 | 5:44 pm on May 30, 2010 (gmt 0) |
FYI date is a reserved word and you shouldn't use it as a column name
|
|