I have been trying to get a simple insert to work and i cant see why it isnt working. The table has 1 row and im able to get the data using a select but when i insert nothing happens. There are no php errors thrown but there is a pdo error thrown but i still cant see where the problem is. Here is the code
$Src = "asd";
$Title = "imgasd";
$Table = "asd";
$TableRow = 123;
$External = 0;
$Type = "image";
$Thumb = "asd";
$Summery = "asd";
$stmt = $db->prepare("INSERT INTO Media (Title, Summery, Src, Table, TableRow, External, Type, Thumb) VALUES (:Title, :Summery, :Src, :Table, :TableRow, :External, :Type, :Thumb)");
$stmt->execute(array(':Title' => $Title, ':Summery' => $Summery, ':Src' => $Src, ':Table' => $Table, ':TableRow' => $TableRow, ':External' => $External, ':Type' => $Type, ':Thumb' => $Thumb)) or die(print_r($stmt->errorInfo(), true));
The code above throws no php errors but returns the following in the browser. I dont know if ive made an incredibly stupid mistake or what but i cant get this to work
Array ( [0] => 42000 [1] => 1064 [2] => 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 'Table, TableRow, External, Type, Thumb) VALUES ('imgasd', 'asd', 'asd', 'asd', '' at line 1 )