Question
I am trying to update a database through a PHP script with the following SQL: $insertSQL = ALTER TABLE `nmc_records` ('recordID', 'recordTitle', 'recordYear', 'pubID', 'catID',
I am trying to update a database through a PHP script with the following 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 that corresponds to your MySQL server version for the right syntax to use near '('recordID', 'recordTitle', 'recordYear', 'pubID', 'catID', 'recordPrice') ' at line 1"
What is the problem with my code and how can it be fixed to function correctly and update the database?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started