PHP PDO problem..
Posted: Tue Jan 23, 2007 9:14 am
HI,
I'm having some problems getting PDO to cooperate with me. I can connect to my DB, then do a PDO->query() inside a foreach just fine. The problem occurrs when I try to do anything but a select statement. Here's a snippet.
The code never throws any errors, and acts like everything went successfully. However, there are no additions to my DB. I'm completely baffled. Mostly because $db->query() inside a foreach works like a charm. Any ideas??
I'm using PHP 5.1 and mySQL 5.0 with PDO on Debian Etch. Running 2.6.17-2-686 kernel.
Thank you in advance for your responses!
EDIT: I just checked my mysql.tables_priv table. My user has Select and Update permissions on my pictures DB. Thanks --Sean
I'm having some problems getting PDO to cooperate with me. I can connect to my DB, then do a PDO->query() inside a foreach just fine. The problem occurrs when I try to do anything but a select statement. Here's a snippet.
Code: Select all
$db = new PDO('mysql:host=localhost;dbname=pictures', user, 'password' );
$db->beginTransaction();
$db->exec( "INSERT INTO pics (description) VALUES (" . $desc . ") WHERE id =" . $picid );
$db->commit();
echo( "Your description has been added successfully." ) ;I'm using PHP 5.1 and mySQL 5.0 with PDO on Debian Etch. Running 2.6.17-2-686 kernel.
Thank you in advance for your responses!
EDIT: I just checked my mysql.tables_priv table. My user has Select and Update permissions on my pictures DB. Thanks --Sean