You are here: Prepared Statment seems to run but doesn't affect database « PHP Programming Language « IT news, forums, messages
Prepared Statment seems to run but doesn't affect database

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация