PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #1243

prepare() handles "!=" as token

Details

Submitted2004-04-20 08:17 UTC
Fromsarukar at hotmail dot com
Assigneddanielc
StatusBogus
PackageDB
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-04-20 08:17 UTC] sarukar at hotmail dot com

Description:
------------
the prepare function handles the search for tokens too simple which e.g. results in misinterpreting the sql-operator "!=" as a valid token and therefore produces a DB::mismatch error.

Reproduce code:
---------------
$db->query("SELECT * FROM table WHERE a!='' AND (b < ? OR b > ? )", array( 3, 4 ) );

Expected result:
----------------
query is executed

Actual result:
--------------
DB:mismatch error

[2004-04-20 08:55 UTC] sarukar at hotmail dot com

changed OS to "irrelevant"