I am trying to create a form that inputs data to my database however I am getting a syntax error unexpected T_String on line 56. The line in question is my SQL Insert statement but I can't find my error. My code is included below and any help would really be appreciated.
foreach ($postNameArr as $postName){
if (array_key_exists($postName, $_POST)){
$w = "INSERT INTO tblContent('PageHeading', 'SubHeading', 'Content', 'PageTitle', 'MetaDescription', 'MetaKeywords') VALUES (["ph"],["sh"],["pc"],["pt"],["md"],["mk"])";
//if it works...
if ($conn->query($w) === TRUE) {
echo "New record created successfully";
}
//error handling
else {
echo "Error: " . $w . "<br>" . $conn->error."');";
}
$conn->close();
}
}