note 61948 rejected from function.pdo-exec by sp
| From: | sp@php.net | Date: | Wed, 15 Feb 2006 21:05:59 +0000 |
| Subject: | note 61948 rejected from function.pdo-exec by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-103795@lists.php.net to get a copy of this message | ||
Note Submitter: wolfmoon at o2 dot pl
----
<?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)