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? 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 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. 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. Link to comment https://forums.phpfreaks.com/topic/37199-solved-mysql-select-multiple/#findComment-177750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.