Trying Update Database Php Script Following Sql Insertsql Alter Table Nmcrecords Recordid Q34184958

I am trying to update a database through a PHP script with thefollowing SQL:

$insertSQL = “ALTER TABLE `nmc_records` (‘recordID’, ‘recordTitle’, ‘recordYear’, ‘pubID’, ‘catID’, ‘recordPrice’) VALUES (‘$recordID’, ‘$recordTitle’, ‘$recordYear’, ‘$recordPublisher’, ‘$recordCategory’,’$recordPrice’)”;

However I keep getting an error saying:

“Error: ALTER TABLE `nmc_records` (‘recordID’, ‘recordTitle’,’recordYear’, ‘pubID’, ‘catID’, ‘recordPrice’) VALUES (”, ”, ”,”, ”,”)
You have an error in your SQL syntax; check the manual thatcorresponds to your MySQL server version for the right syntax touse near ‘(‘recordID’, ‘recordTitle’, ‘recordYear’, ‘pubID’,’catID’, ‘recordPrice’) ‘ at line 1″

What is the problem with my code and how can it be fixed tofunction correctly and update the database?

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *