note 102338 added to pdostatement.execute

From: Date: Wed, 09 Feb 2011 11:10:45 +0000
Subject: note 102338 added to pdostatement.execute
Groups: php.notes 
Request: Send a blank email to php-notes+get-176806@lists.php.net to get a copy of this message
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! ---- Server IP: 217.160.235.204 Probable Submitter: 91.190.226.92 ---- Manual Page -- http://www.php.net/manual/en/pdostatement.execute.php Edit -- https://master.php.net/note/edit/102338 Del: integrated -- https://master.php.net/note/delete/102338/integrated Del: useless -- https://master.php.net/note/delete/102338/useless Del: bad code -- https://master.php.net/note/delete/102338/bad+code Del: spam -- https://master.php.net/note/delete/102338/spam Del: non-english -- https://master.php.net/note/delete/102338/non-english Del: in docs -- https://master.php.net/note/delete/102338/in+docs Del: other reasons-- https://master.php.net/note/delete/102338 Reject -- https://master.php.net/note/reject/102338 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#176806) next »