|
Posted by toomanyjoes on 07/13/06 15:38
I have written a function that runs a prepared statement and it seems
to run just fine but when I check to see the affected rows nothing is
affected. Can someone take a look at my code and tell me if they notice
anything wrong outright.
[CODE BLOCK for config.php]
function QueryDB_mysqli($query, $typeStr, $varStr){
$db_connection = new mysqli(DB_HOST, DB_USER, DB_PASSWORD,DB_DATABASE);
$statement = $db_connection->prepare($query);
$statement->bind_param($typeStr, $varStr);
$statement->execute();
$statement->close();
exit();
}
[END CODE BLOCK]
[CODE BLOCK for mgb.php]
$varStr = $userID . "," . $end_book . "," . $start_book . "," . $title
.. "," . $notes . "," . $start_date . "," . $end_date . "," . $skip_days
.. "," . $email_reminder . "," . date("Ymd",time()) . "," . $today;
$typeStr = "sssssssssss";
QueryDB_mysqli("INSERT INTO
schedule
SET
userID=?,
end_book =?,
start_book=?,
title=?,
footnotes=?,
start_date=?,
end_date=?,
skip_days=?,
email_reminder=?,
last_accessed=?,
creation_date =?", $typeStr, $varStr);
[END CODE BLOCK]
I can't understand why it wouldn't throw an error yet insert nothing
into the database. Any help would be greatly appreciated.
Thanks in advance,
Joe
Navigation:
[Reply to this message]
|