I have the following code in a php file on my server, and it's supposed to take simple POST input from a HTML form and store it in a database.
$var_name = $_POST[post_name];
$var_email = $_POST[post_email];
$var_id = intval($_POST[post_id]);
echo "Name=".$var_name.", email=".$var_email.", id=".$var_id;
$status = $db->query("insert into names (name, email, id) values ('$var_name', '$var_email', $var_id)");
var_dump($status);
All of the POST variables are correct, they all store the data I entered into the form, and db is definitely set up correctly, as running the following code works as expected, printing out each line in the database:
$results = $db->query('SELECT * FROM names');
while ($name = $results->fetchArray())
echo $name[0]."\n";
What happens is, var_dump($status) proves that $status is false. How can it be false? What am I doing wrong? Inserting the query line into the sqlite3 CLI works perfectly, so I can't see what's wrong. Thanks
var_dump($query->ErrorInfo())