Error in MySQL update command. (in php) -
Good morning all,
I use an update command in php to update data in mysql I am doing This is my code:
$ sql = mysql_query ("Update Blobbutation SET Journalname = '$ _POST [Journal]', AcceptedDate = '$ _POST [Approved]', published data = ' $ _POST [published date] ', comment =' $ _POST [comment] 'where no job =' $ _POST [job] '';; if (! Mysql_query ($ sql, $ con)) {dead ('error:' . Mysql_error ();;) "Update Record" echo;
This area updates, but, it gives me the following error and I can not understand that I have this errorYon has been found "error is an error in your SQL syntax; The manual that matches your MySQL server version to use the "1" on line 1 for the correct syntax for your syntax
Can you help me in this
Best Word
Can you tell us that $ sql
What is it? By the way, there is a large security hole that you want to query to avoid always
$ journal = mysql_real_escape_string ($ _ POST) ['Journal']); $ Approval _data = mysql_real_escape_string ($ _ POST ['Approved']); $ Publish_date = mysql_real_escape_string ($ _ POST ['published date']); $ Comment = mysql_real_escape_string ($ _ POST ['comment']); $ Job_no = intval ($ _ POST ['Job no']); // Assigning a number is not $ sql = & lt; & Lt; & Lt; Set blpublication SET journalname = '$ journal', acceptanceDate = '$ acceptance_date', published data = '$ publish_date', comment = '$ comment' where JobNo = $ job end; Mysql_query ($ sql); If (mysql_error ()) {error ("Error in executing query '$ sql':". Mysql_error ()); } "Update Record" echo;
Comments
Post a Comment