PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #3081

unescaped ! don't work even though enclosed in ''

Details

Submitted2005-01-03 14:46 UTC
Fromtooar at gmx dot net
Assigneddanielc
StatusWont fix
PackageDB
PHP Version4.3.10
OSLinux/Debian
Roadmaps(Not assigned)

Comments

[2005-01-03 14:46 UTC] tooar at gmx dot net

Description:
------------
When updating a row, I have to escape ! chars (exclamation mark) even though the complete string is enclosed in '' and run through escapeSimple(). In phpmyadmin, I don't have to do it. When not escaping ! chars, i get "DB Error: mismatch".

Reproduce code:
---------------
UPDATE tbl SET text='!'

Expected result:
----------------
The text column should contain an !

[2005-01-03 15:06 UTC] tooar at gmx dot net

But why does neither escapeSimple() nor quoteIdentifier() or quoteSmart() escape it? Why do also the php mysql escape functions not escape it (mysql_escape_string() and mysql_real_escape_string())?

Does it mean if have to start and do string replacement to filter ! with my own code because nobody ever thought of writing a utility function? Or maybe, it is a bug as it works in phpmyadmin?

Besides, it's somewhat strange to have to escape characters that are already enclosed in ''. What's the point of the '' then when i still have to escape all kind of characters?

In SQL this isn't necessary!