Over the past few years I've migrated to PDO use within PHP and for the most part the results are successful. However, there are times when the opposite is true.
After spending the better part of several days researching an failing UPDATE I thought I would ask here to find out what others are doing to debug these unknown errors.
Im using MariaDB on a WHS server managed with cPanel.
My MySQL logs are turned on.
I'm using the ^ALL declarative with PHP.
error_reporting(E_ALL ^ E_NOTICE);
I include the errorreporting attribute after opening the DB:
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
and everything else I regularly use or find via research.
My symptom is this:
Open DB,
Construct SQL Query with tokens,
Prepare the SQL statement,
Bind the variable values,
execute the query,
intercept errors,
$t0 = $pdo->prepare("$sql");
$t0->bindValue(':coordinator',$coordinator);
try { $t0->execute(); }
catch (PDOException $e) { db_die("$e->getMessage()); }
and the result is NO failures, return code of 0, no error message, no errors written to log files in /var/log/mysql/sitename/*
and seeing how I'm trying to show everything here - this is the SQL statement.
UPDATE ss_tasks SET
coordinator = :coordinator,
coordinator_id = :coordinator_id,
sched_date = :sched_date,
sched_time = :sched_time,
todo_description = :todo_description,
todo_priority = :todo_priority
WHERE task_id = :task_id
LIMIT 1
Honestly, I HOPE someone finds a simple error that my eye/brain simply overlooked.
Thanks for any advice,suggestions,etc/
After spending the better part of several days researching an failing UPDATE I thought I would ask here to find out what others are doing to debug these unknown errors.
Im using MariaDB on a WHS server managed with cPanel.
My MySQL logs are turned on.
I'm using the ^ALL declarative with PHP.
error_reporting(E_ALL ^ E_NOTICE);
I include the errorreporting attribute after opening the DB:
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
and everything else I regularly use or find via research.
My symptom is this:
Open DB,
Construct SQL Query with tokens,
Prepare the SQL statement,
Bind the variable values,
execute the query,
intercept errors,
$t0 = $pdo->prepare("$sql");
$t0->bindValue(':coordinator',$coordinator);
try { $t0->execute(); }
catch (PDOException $e) { db_die("$e->getMessage()); }
and the result is NO failures, return code of 0, no error message, no errors written to log files in /var/log/mysql/sitename/*
and seeing how I'm trying to show everything here - this is the SQL statement.
UPDATE ss_tasks SET
coordinator = :coordinator,
coordinator_id = :coordinator_id,
sched_date = :sched_date,
sched_time = :sched_time,
todo_description = :todo_description,
todo_priority = :todo_priority
WHERE task_id = :task_id
LIMIT 1
Honestly, I HOPE someone finds a simple error that my eye/brain simply overlooked.
Thanks for any advice,suggestions,etc/