I am very new to php/mysql and have inherited serveral sites that use both -extensively. I am giving my self a crash course and moving along well...until now. I have been working on this issue for about a week (solid) and have decided to finally ask...someone - I haven't been able to find anything online anywhere that is specfic enough to my problem. My hosting company offers PHP 4.0 & 5.0 however I currently have 4.0 enabled as I am skeptical to use 5.0 since my webage(s) are older and I don't need any major breaks until I learn more. The previous designer wasn't an advocate of WC3 validation and was not attention-to-detail oriented, so to me, most of the site feels like a house-of-cards. To the issue....
This query *works PEFECTLY in the MySQLAdmin interface:
SELECT r.id, r.type, r.name, r.street, r.city, r.state, r.zip, r.phone, r.accounttype, bl.relation, bl.username AS business_listing_username, url.url, url.username AS url_username, c.optionvalue, c.name AS category_name
FROM restaurant AS r
LEFT OUTER JOIN business_listing AS bl ON r.id = bl.relation
LEFT OUTER JOIN url_mapping AS url ON bl.username = url.username
RIGHT JOIN category AS c ON r.type = c.optionvalue
WHERE r.city LIKE '
citynamehere'
ORDER BY `r`.`name` ASC
This *works PEFECTLY in PHP on the webpage:
"SELECT r.id, r.type, r.name, r.street, r.city, r.state, r.zip, r.phone, r.accounttype, bl.relation, bl.username AS business_listing_username, url.url, url.username AS url_username, c.optionvalue, c.name AS category_name
FROM restaurant AS r
LEFT OUTER JOIN business_listing AS bl ON r.id = bl.relation
LEFT OUTER JOIN url_mapping AS url ON bl.username = url.username
RIGHT JOIN category AS c ON r.type = c.optionvalue
WHERE r.city LIKE '
citynamehere'";
Once I add the
ORDER BY to the PHP on the webpage IN ANY FORM, regardlesss of backticks, alias names, or any other combination I have tried, the website displays NOTHING (yes my text is a different color than the background). There are no results, no errors, just a blank. I am ready to lose my mind.

Other PHP scripting on the page has been removed, just in case there was a conflict somewhere, but no other unrelated scripting is contained in my <?php tags.
I have NEVER posted on a forum before so I don't really know what other information may be required to solve this problem, other than the PHP query WORKS until I add the ORDER BY. What the query is doing is rather complicated in my mind, but does exactly what I am asking it to do.
Any help would be greatly appreciated - I fear I will never grasp this stuff.
Thanks!
JB
*Works PEFECTLY = ALL data prints out as anticipated.