With proper syntax. ;) Your WHERE conditions are improperly arranged. SELECT * FROM stores,subcategory,category WHERE (stores.category = $category->id AND subcategory.category = $category->id) OR stores.zip = $cityzip ORDER BY name;
Also, assuming you're coding this in PHP, you need to make sure you handle the variable names properly (dot concatenation). Edward Dudlik Becoming Digital www.becomingdigital.com ----- Original Message ----- From: "Tad Ellis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, 15 June, 2003 19:27 Subject: mmmh hello and thank you for your time. how should i code: select * from stores,subcategory,category where stores.category and subcategory.category = $category->id and stores.city or stores.zip = $cityzip order by name thank you again, tad -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] addisonellis.com THIS E-MAIL AND ANY FILES TRANSMITTED WITH IT ARE CONFIDENTIAL AND ARE INTENDED SOLELY FOR THE INDIVIDUAL OR ENTITY TO WHOM THEY ARE ADDRESSED. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DO NOT READ, COPY OR RE-TRANSMIT THIS COMMUNICATION BUT DESTROY IT IMMEDIATELY. ANY UNAUTHORIZED DISSEMINATION, DISTRIBUTION OR COPYING OF THIS COMMUNICATION IS STRICTLY PROHIBITED. A -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]