Problem:
The following database operation fails the statement execute method fails silently, I can see 'lol' printed but not 'derp' so I know the prep is all good, it just fails at execute().
No idea what could be causing this error, I know the DB is functioning as I can pull values from it using SQL statements with prepare()
and execute()
. Any help would be greatly appreciated...
$category = 'Derpenstien';
$order = 1;
$parentID = 1;
$query = "insert into category (name, ordering, parent_id) values (:name, :ordering, :parent)";
$newEntry = $db->getdb()->prepare($query);
$newEntry->bindParam(':name', $category, \PDO::PARAM_STR);
$newEntry->bindParam(':ordering', $order, \PDO::PARAM_INT);
$newEntry->bindParam(':parent', $parentID, \PDO::PARAM_INT);
var_dump('lol');
$newEntry->execute();
var_dump('derp');