Guest Posted February 5, 2007 Share Posted February 5, 2007 SELECT DISTINCT * FROM zipcode WHERE STATE='FL' AND CITY='ORLANDO' OR STATE='FL' AND CITRY='WINTER PARK' AND ZIP_CLASS='STANDARD' Im trying to select zipcodes from th database where city is orlando or winter park and state = florida and zipclass = standard I dont know how to do this exactly can someone help me? Quote Link to comment https://forums.phpfreaks.com/topic/37199-solved-mysql-select-multiple/ Share on other sites More sharing options...
richardw Posted February 5, 2007 Share Posted February 5, 2007 Try using DISTINCT on one field in your table first. Also, is ZIP_CLASS defined? <?php SELECT DISTINCT FROM fieldnamehere WHERE (CITY = 'ORLANDO' OR CITY = 'WINTER PARK' ) AND ZIP_CLASS='STANDARD'; ?> OR I think you may mean this... a guess anyway. Also be aware of the case, ie ORLANDO will not match Orlando. <?php SELECT DISTINCT FROM ZIP_CLASS WHERE (CITY = 'ORLANDO' OR CITY = 'WINTER PARK' ) ORDER BY ZIP_CLASS asc; ?> best Quote Link to comment https://forums.phpfreaks.com/topic/37199-solved-mysql-select-multiple/#findComment-177702 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 MySQL column values are case-insenstive for searching, unless the collation says otherwise (not the default). Also, DISTINCT * makes no sense whatsoever. Quote Link to comment https://forums.phpfreaks.com/topic/37199-solved-mysql-select-multiple/#findComment-177735 Share on other sites More sharing options...
Guest Posted February 5, 2007 Share Posted February 5, 2007 Thank you i got it. Quote Link to comment https://forums.phpfreaks.com/topic/37199-solved-mysql-select-multiple/#findComment-177750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.