note 102338 rejected from pdostatement.execute by thiago

From: Date: Wed, 09 Feb 2011 11:12:56 +0000
Subject: note 102338 rejected from pdostatement.execute by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-176807@lists.php.net to get a copy of this message
Note Submitter: djlopez at gmx dot de ---- I recognized, that the return value stay TRUE, even if the sql statement could not be executed correctly. Example: $sth = $this->db->prepare("REPLACE INTO test SET bar = :foo); $error = $sth->execute(array('foo' => 'bar')); /* $error will be TRUE, because sql is correct and sent. However, if the mysql user has not the rights (INSERT,DELETE) to do this, the statement will be not executed at all without error message. So, don't rely on the returning value until this is fixed!

« previous php.notes (#176807) next »