Lively discussions on the graphic arts and publishing — in print or on the web

Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 06-01-2006, 04:25 AM   #1
Tim Lodge
Join Date: Aug 2005
Location: UK
Posts: 34
Default More MySQL 'ORDER BY' Woes

I read about the difficulties Marjolein had with 'ORDER BY' yesterday, only to run into a similar problem of my own this morning! I just happened to check the small ads page at http://www.drascombe-association.org.uk/smallads.htm and found that it wasn't showing any results from the database. After an hour or so of hair-tearing I discovered that I could get the results to display again by removing the 'ORDER BY' statement from the following query:

 $Query = "SELECT *, DATE_FORMAT(adate, '%D %M %Y') AS displaydate 
	 FROM $TableName1 AS t1, $TableName2 AS t2 
	 WHERE t1.boattype = t2.type AND t1.sold='no' AND t1.adate >= '$LastDanDate' 
	 ORDER BY t1.adate DESC";
I'm pleased to have got it working again, but it's less than ideal that the adverts now appear in more or less random order. I've also had to amend most of the admin pages in the same way.

I suspect strongly - and I'm awaiting confirmation - that my hosting provider has done a version upgrade. The old pages still work on my test server, which is running MySQL 3.23.49, while the production server is running MySQL 4.1.18.

It seems to be the fact that I'm querying more than one table which breaks it. Can anyone spot a problem with my query, or suggest a workaround?



Tim Lodge

Tim Lodge is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Back woes ktinkel The Corner Pub 13 11-16-2006 02:58 PM
Firefox woes Franca General Publishing Topics 3 06-28-2006 01:24 PM
Firefox woes CarlSeiler The Corner Pub 5 04-01-2006 02:39 PM
Email woes LoisWakeman The Corner Pub 27 03-31-2006 12:34 PM

All times are GMT -8. The time now is 09:42 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2023, vBulletin Solutions, Inc.
Contents copyright 2004–2019 Desktop Publishing Forum and its members.