Possible getOne bug?
| From: | Daniel Simser | Date: | Sat, 11 Jan 2003 23:55:08 +0000 |
| Subject: | Possible getOne bug? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3245@lists.php.net to get a copy of this message | ||
We have a interesting bug we think we have found with getOne() and Postgres with php4.3 and the latest version of pear
Here is a sample sql query that is sent into getOne:
$sql = "SELECT count(\"USER_ID\") FROM \"_user\" WHERE \"USERNAME\" ilike '%"bob\'s"%' ";
if(DB::isError($return = $_db["dbh"]->getOne($sql,DB_FETCHMODE_ASSOC))) {
echo "errors here..."; // we use getMessage() etc...} -------------------------- for some reason or another the query ends up something like: SELECT count(\"USER_ID\") FROM \"_user\" WHERE \"USERNAME\" ilike '%bob2's%' NOTICE the "2" after "bob". We are not using magic_quotes_gpc but we do addslashes before we make the call... Does anybody know why the heck the "2" is in the query. --------------------------- Thank you all for any help with this problem... Daniel Simser