I've got a really strange problem.
I'm making an ajax call to the server sending form details to a php script. Using PDO i then insert the values into the database. Firebug returns a 500 error BUT the values ARE INSERTED into the database. I can't find anything in the error log (i looked in apache error log and mysql error log)
I'm running centos 6, php 5.3.3 and mysql 5.1.
I looked through the php sysinfo and saw this in the apache config:
'--disable-pdo'
Not sure if that has anything to do with it, but hey..
Here is the code i'm using:
try {
$conn = new PDO('mysql:dbname=dbname;host=localhost', 'username', 'password');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = $conn->prepare('INSERT INTO sometable (naam, beroep, telefoon, emailadres, bericht, ismedical)
VALUES(:naam, :beroep, :telefoon, :emailadres, :bericht, :ismedical)');
$query->execute(array(
':naam' => $naam,
':beroep' => $beroep,
':telefoon' => $telefoon,
':emailadres' => $emailadres,
':bericht' => $bericht,
':ismedical' => $ismedical
));
echo $stmt->rowCount(); // should be 1
} catch (PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}