| | |
Update query with syntax error
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2009
Posts: 14
Reputation:
Solved Threads: 1
I have the following update code but i keep getting a syntax error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE order_id='105'' at line 21
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE order_id='105'' at line 21
PHP Syntax (Toggle Plain Text)
mysql_query("UPDATE status SET id = '". $_POST['id'] ."', user_name = '". $_POST['user_name'] ."', to_serve_on = '". $_POST['to_serve_on'] ."', pri_address = '". $_POST['pri_address'] ."', sec_address = '". $_POST['sec_address'] ."', alt_address = '". $_POST['alt_address'] ."', home_tel = '". $_POST['home_tel'] ."', work_tel = '". $_POST['work_tel'] ."', cell_tel = '". $_POST['cell_tel'] ."', type_of_serve = '". $_POST['type_of_serve'] ."', doc_arrival = '". $_POST['doc_arrival'] ."', date_received = '". $_POST['date_received'] ."', court_name = '". $_POST['court_name'] ."', court_address = '". $_POST['court_address'] ."', case_number = '". $_POST['case_number'] ."', plaintiff = '". $_POST['plaintiff'] ."', defendant = '". $_POST['defendant'] ."', doc_order_notes = '". $_POST['doc_order_notes'] ."', progress = '". $_POST['progress'] ."', WHERE order_id='". $_POST['order_id'] ."'") or die(mysql_error());
0
#2 Oct 13th, 2009
Couple of things.
1. Why are you sending unchecked POST values to the database? That is just asking for trouble. Look at SQL injection.
Make sure that the values you receive are the ones you expected, that numbers are numbers etc...
2. Try running the query without single quotes on the numeric value.
1. Why are you sending unchecked POST values to the database? That is just asking for trouble. Look at SQL injection.
Make sure that the values you receive are the ones you expected, that numbers are numbers etc...
2. Try running the query without single quotes on the numeric value.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
![]() |
Similar Threads
- Syntex error in UPDATE Query C#---MS ACCESS (C#)
- Update query error (PHP)
- Syntax error in UPDATE statement. (VB.NET)
- storing url in variable and query update error (PHP)
- Error while trying the update query (ASP)
- IE Syntax Error and Can“t browse some sites (Viruses, Spyware and other Nasties)
- UPDATE syntax error (MySQL)
Other Threads in the PHP Forum
- Previous Thread: passing varaible between pages ussing sessions
- Next Thread: Display Php echo information on html pages
Views: 801 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for error, syntax, update
-xlint 1 429 activex ajax apache apple application basic blue bsod business c++ cart char* class code collaboration compile compiler component computer database datepart delphi design dns email error errors file firefox firmware floatingpoint gamer gaming gmail google gridview gui ide input install internet iphone iphone2.1 java javac jni keywords leopard linker mac microsoft mistake msaccess mssql mysql news object office osx output parse patch php port problem programming ps3 python query reference reformat remote return richtextbox rows ruby screen security server sharepoint shopping small software sqlserver syntax templates trojan undefined undosend update vb2008 virus vista visual windows xml xp







