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
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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.