Hi,
I'm trying to echo only the upcoming ads in a table but is jumping like 4 ads
The database field is a TIMESTAMP
2008-04-15 08:57:29
2008-04-15 11:53:27
2008-04-15 16:24:48
2008-04-16 08:58:15

At this time Tuesday, April 15, 2008 / 9:19 AM was only showing 2008-04-16 08:58:15 Not showing 2008-04-15 11:53:27 and 2008-04-15 16:24:48 the are before.
Here's my SQL statement I can see whats wrong can someone help me with this

SELECT ads.ad_id, ads.ad_date, source.source FROM ads LEFT JOIN source ON ads.ad_source = source.source_id WHERE ads.ad_date >= NOW() 

    ads.ad_date >= NOW()

    change to

    ads.ad_date <= NOW()

    Is that what you wanted?

      Sheephat that will show Previous ads DATESTAMP <= NOW() I think is a bug or something because if DATESTAMP (is 2008-04-16 08:58:15) >= NOW() (is 2008-04-16 08:57:15) it should show

        That exactly it !! How can that be? When computer and Server time was Tuesday, April 15, 2008 / 9:32 PM my db NOW() was 2008-04-16 05:27:57 and I think the server is the same way

          The server MySQL have the same time as the one in my computer. I thought that MySQL suppose to have the same date and time as the computer.

            Sheephat I so sorry the problem is with the phpadmin (MYSQL) time in the server now I just need to find out how to convert to my time ZONE

              So its solved?

              It may be best, if your data is inserted via PHP, to insert the time from the form. That is what I do, using time() then convert the time back using date() to a readable format.

                Sheephat, This is what I did

                ads.ad_date >= SUBTIME(NOW(),'0 8:1:1')
                

                Thanks

                  Write a Reply...