Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- sql update statement mistake


rocknbil - 4:54 pm on Jun 14, 2011 (gmt 0)


From what you've given, the error is in your last field.

shutoff = '".$shutoff."',";

ends with a comma

shutoff='12345',

Unless the where clause is missing, it's still an error though

shutoff = '".$shutoff."', where record_id=23456;

should be

shutoff = '".$shutoff."' where record_id=23456;

If not, without a where this will update all records in the database. Not good, that's a big mistake . . .

Otherwise you probably have a quote in the input (?)


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4325891.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com