Copy link to clipboard
Copied
I have a page where I am trying to display the name ,date, and location of our next event by sortig the data
by date and using a where clause to exclude previous events.
I set up the recordset in DW cs4 and push test and it works fine.
Here is the mysql query :
SELECT events.NAME, events.LOCATION, events.`DATE`, events.EDATE
FROM events
WHERE events.EDATE > now()
ORDER BY events.EDATE
date field is just string data
edate is actual date I want to sort on
I have tried using edate=> currdate() and that returns the same incorrect results.
I am using Dreamweaver CS4 and mysql 5.1.
When I use my web host utility for mysql 5.1 the same query works there also.
It also works inside my localhose mysql 5.1
The only place it doesn't work is in the page.
link to page
http://www.taasports.org/test.php
I temporarily have the full dataset on the lower part of the page and it is not ordered.
Please let me know if I need to add more info etc. I am really stuck with this.
Thanks in advance
Keith
Copy link to clipboard
Copied
Why are you calling the recordset over and over again? The last one executed is the one that will be used. It does not have an order by clause:
$query_rsNext = "SELECT NAME, LOCATION, `DATE`, EDATE FROM events WHERE `EDATE` >= curdate()";
Copy link to clipboard
Copied
Thank you very much Bregent. That fixed it. I was
not looking at the code and it appears dreamweaver was adding a new statement everytime I change the s
ql statement. I deleted all of them except the correct one and now it works.
Thanks again
Keith
Copy link to clipboard
Copied
You're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now