When I execute a pdo that specifies some but not all fields in a table, it inserts fine on one server, but fails to insert on the other server.
FOR EXAMPLE, ON THE PROBLEM SERVER...
With table that has three fields id
, time
, and intervention
...
If I run this statement, it inserts as expected.
$query = "INSERT INTO data_agreements (`id`, `time`, `intervention`) VALUES (?, ?, ?)";
$q = $pdo->prepare($query);
$q->execute(array("x", "y", "z"));
But if I run the following statement, it fails to insert.
$query = "INSERT INTO data_agreements (`id`, `time`) VALUES (?, ?)";
$q = $pdo->prepare($query);
$q->execute(array("x", "y"));
The problem server is an IIS with MySql 5, PHP 5.2.6. On a different server Apache with MySql 5, PHP 5.2.6, both statements insert as expected. So I am wondering if there is some MySQL install/setting that I need to set on the problem server to tell it to accept statements that specify only a subset of fields in a table. ?
Thanks!