MySQL Forums
Forum List  »  Newbie

SQL Command
Posted by: Justin Pratt
Date: December 11, 2006 01:17PM

I am writing a SQL statement in php with a mysql backend. I want to delete all records in a table that the city is not Colorado City, Rye, San Isabel, Beulah, or Hatchet Ranch. Right now this is what i have but it is deleting everything:

$result = mysql_query("DELETE FROM Property WHERE City != 'Rye' OR City != 'Colorado City' OR City != 'San Isabel' OR City != 'Beulah' OR City != 'Hatchet Ranch'", $linkID);

anyone have an idea of how this statement should look? Please help

Options: ReplyQuote

Written By
SQL Command
December 11, 2006 01:17PM
December 11, 2006 02:21PM
December 11, 2006 02:44PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.