Hi,
I have recently learned how to join tables in queries with mysql.
But, like anything new, I am running into some problems.
I would like the results to be sorted by datetime, but for some reason they are sorted in random order. I have listed the queries that I am using below with a link to a page where you can see the results of each query.
s.date2 = (datetime) opening date
s.close = (datetime) closing date
Query: random order (joined)
http://www.blackmarketculture.com/events/on_display.php
Query: ordered by datetime (no join)Code:SELECT * FROM galleries g,shows s WHERE g.gallery_id = s.gallery_id AND UNIX_TIMESTAMP('".$today."') >= UNIX_TIMESTAMP(s.date2) AND UNIX_TIMESTAMP('".$today."') <= UNIX_TIMESTAMP(s.close) ORDER BY 's.date2'
http://www.blackmarketculture.com/ev...ay_no_join.php
Thank you for your time,Code:SELECT * FROM shows WHERE UNIX_TIMESTAMP('".$today."') >= UNIX_TIMESTAMP(date2) AND UNIX_TIMESTAMP('".$today."') <= UNIX_TIMESTAMP(close) ORDER BY 'date2'
-Mike


Reply With Quote
Bookmarks