note 102338 rejected from pdostatement.execute by thiago

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.