I am getting a 42000 PDO error, I know this has to do with MySQL reserved words and I have put all my column names in backticks. However, this has not solved my problem. I am using Xampp on Windows 10, I am wondering if it could be an Apache or MySQL error and not a PHP syntax error?
class ItemList {
private $pdo;
public function add() {
$stmt = $this->pdo->prepare("INSERT INTO `item` (`ID`, `userID`, `name`, `description`, `price`, `link`, `image`)
VALUES (NULL, :userID, :name, :description, :price, :link, :image)");
$stmt->execute(array(':userID' => $_SESSION['userID'],
':name' => $_REQUEST["name"],
':name' => $_REQUEST["name"],
':description' => $_REQUEST["description"],
':price' => $_REQUEST["price"],
':link' => $_REQUEST["link"],
':image' => $_REQUEST["image"]
));
}
}
I know this may be a stupid easy answer and that I may just be stuck and I know there are some similar questions out there already. But any help would be greatly appreciated, thanks in advance.