| | |
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: 12
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
| Thread Tools | Search this Thread |
-xlint 7 429 2010 activex ajax apple application beginner blue browser bsod bulletin c# c++ char* class code collaboration compiler component computer database datepart design development dns eclipse email embedded error errors file firefox firmware floatingpoint gamer gaming gmail google gui install internet iphone iphone2.1 java javac jni jvm keywords leopard linker list mac microsoft mistake mozilla multiple mysql news object onreadystatechange osx panel parse patch php playstation port problem programming ps3 pwnage python reformat remote return ruby screen security sharepoint software sony space sqlserver syntax transform trojan undosend update virus vista visual vulnerability win windows windowsxp xml xp xsl







