SQl for Does Not Equal

How in the world do you write a query for matches that don’t equal a text string??

$sql = mysql_query("SELECT * from table WHERE column DOES NOT EQUAL 'abc'");

Try this:


 [color=#000000][color=#0000bb] $sql [/color][color=#007700]= [/color][color=#0000bb]mysql_query[/color][color=#007700]([/color][color=#dd0000]"SELECT * from table WHERE column != 'abc'"[/color][color=#007700]);  
 

[/color][/color]

I always used NOT LIKE, but I would say the above works too. It its just a bit different. Just wanted to throw another method out there :smiley:

$sql = mysql_query("SELECT * from table WHERE column NOT LIKE 'abc'");

Thanks guys! != worked fine, I thought that was PHP specific, didn’t know it would work in SQL syntax. :slight_smile: