Skip to main content
Participant
January 26, 2010
質問

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

  • January 26, 2010
  • 返信数 1.
  • 441 ビュー

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

このトピックへの返信は締め切られました。

返信数 1

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

kp7769作成者
Participant
January 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

Participating Frequently
January 26, 2010

You're welcome.