Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statement trouble 1

Status
Not open for further replies.

BettyJo50

Technical User
Apr 25, 2002
47
0
0
US
HI!

Could someone please tell me what is wrong with my SQL statement?

$SQL="UPDATE umcritsurv WHERE $fldAuto=id (IQ_Use_Q9, etc) VALUES ('$IQ_Use_Q9', '$etc')";

This is the error I get:

ERROR: You have an error in your SQL syntax near 'WHERE =id (IQ_Use_Q9, Etc' at line 1 UPDATE umcritsurv WHERE =id (IQ_Use_Q9) etc.....

Thank you!!
 
Several things. Most notably, the "VALUES" clause is only available in an INSERT query, not an UPDATE query. Also, the WHERE clause comes at the end of the query.

In an UPDATE query is of the form:

UPDATE tablename SET columnname = value, columnname = value WHERE somecondition

See MySQL online documentation on the UPDATE query

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top