| | |
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 64bit 429 2010 activex ajax apple application backup blue browser bsod business c++ char* code collaboration compiler component computer control database datepart design dns eclipse email embedded error errors file firefox firmware floatingpoint gamer gaming gmail google gui input install internet iphone iphone2.1 java javac jni jvm keyword keywords leopard linker list mac management microsoft mistake mozilla mysql news object onreadystatechange osx output parse patch php playstation port problem programming ps3 python reformat remote return ruby screen security server sharepoint small software sony space sqlserver syntax trojan undosend update vb virus vista visual vulnerability windows windowsxp xml xp







