Link to home
Start Free TrialLog in
Avatar of purpleoak
purpleoakFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Mysql select where not euqal to array values

i need to do a select where a particular field is not equal to any of the values in the array. so for instance my array has

133007
133005
133090

mysql_query("SELECT partnumber FROM table WHERE ordernumber != arrayvalues")

The issue is the amount in the values can change and potentially be 20/30 values.
ASKER CERTIFIED SOLUTION
Avatar of Barry Jones
Barry Jones
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gr8gonzo
@TheFoot

I need to go disable your internet connection so I can get a chance to answer the questions. :)
:)  Gotta try and catch you guys up eh?
hi, another way is
 WHERE not fieldname IN (ListOfValues)
Avatar of LuccyMadcy
LuccyMadcy



WHERE * from Table Where FieldName Not IN (ListOfValues)
Avatar of purpleoak

ASKER

Thank you very much. Exactly what i needed. Sorry i didn't reply sooner. I thought i would post and leave over night. Guess i didn't need to wait all that long.
Glad to help.. thanks for the points..