i am new to PHP MySQL and am having difficulty with one particular query. My code is below:
the $connector is an object and it works fine for every other query I've tried. Is there a problem with the query that I am not seeing?
Code: Select all
$insertQuery = "INSERT INTO documents (pageTitle, headline, intro, subhead, body, category) VALUES ('".$headline."','".$intro."','".$subhead."','".$body."','".$category."')";
//Save the form into the database
if ($result = $connector->query($insertQuery)){
//It worked, give confirmation
echo '<center>Article added to the database</center><br>';
} else {
echo "<center>Sorry, there was an error saving to the database<br><a href='new.php'>Back to Form</a></center><br>";
}