Jump to content

[SOLVED] Mysql SELECT multiple


Guest

Recommended Posts

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

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.