note 61948 added to function.pdo-exec
| From: | wolfmoon at o2 dot pl | Date: | Wed, 15 Feb 2006 20:06:45 +0000 |
| Subject: | note 61948 added to function.pdo-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103792@lists.php.net to get a copy of this message | ||
<?php
function changeUserPassword($uid, $old, $new) {
global $db;
$q = "UPDATE users SET passwd = '$new'
WHERE (id = '$uid') AND (passwd = '$old')";
return($db->exec($q));
}
?>
This function always returned TRUE to me. Regardless of number of rows affected. It seems that with
PDO::exec return value is something wrong. (PDO_PGSQL-1.0.1)
----
Server IP: 81.223.254.85
Probable Submitter: 83.21.34.123
----
Manual Page -- http://www.php.net/manual/en/function.pdo-exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61948
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61948&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61948&report=yes
Search -- http://master.php.net/manage/user-notes.php