I am getting the HY093 error on the $q->execute
line.
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined'
$stmt = "INSERT INTO `survey`(`user`,`notes`,`lat`,`lon`,`acc`,`timestampx`) VALUES(?,?,?,?,?,?)";
$q = sql::$db->prepare($stmt);
var_dump($data);
$q -> execute($data);
and my vardump echos:
array(6) {
["user"]=>string(9) "Your Name"
["notes"]=>string(5) "Notes"
["lat"]=>string(10) "35.1338614"
["lon"]=>string(19) "-106.64091979999999"
["acc"]=>string(4) "8512"
["time"]=>string(13) "1442043552884"
}
When I copy and paste this data into MySQL (replacing the ? with the quoted strings) it works.
Any idea what I might be missing?