Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Order by date clause works in dataset test but not in actual page.

New Here ,
Jan 26, 2010 Jan 26, 2010

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

ka.hebert@att.net

TOPICS
Server side applications
442
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2010 Jan 26, 2010

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()";

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 26, 2010 Jan 26, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 26, 2010 Jan 26, 2010
LATEST

You're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines