MySQL/PHP error, SQL syntax error -
I am trying to use a php to open a CSV file and update the selected data, which is correct Reads the way and some column data may be empty on some lines, but I get the following error:
Error: There is an error in your SQL syntax; When trying to run the address given below, the address of the respective manual related to the SQL Server version for the correct syntax for using the address 'Address 2 = 1654 E 13TH ST apt 1e, address 3 = 4 line' Check it out. Command $ sql = "update vicidial_list SET address 1 = $ fileop [7], address2 = $ fileop [8], address3 = $ fileop [9] where phone_number = $ fileop [ 0] and list_id = '82429711'; "; If (! Mysql_query ($ sql)) {Dead ('Error:' .mysql_error ());
You need quote around your values, or do not know it Find when it ends or starts.
In this way: (or you can use the prepared statement, and it will also solve your problem)
$ sql = "update vicidial_list SET address1 = ' $ Fileop [7] ', address2 =' $ fileop [8] ', address 3 =' $ fileop [9] 'Where phone_number = $ fileop [0] and list_id =' 82429711 '; ";
Comments
Post a Comment