Home » Database » DB » Bug #3081
unescaped ! don't work even though enclosed in ''
Details
| Submitted | 2005-01-03 14:46 UTC |
|---|---|
| From | tooar at gmx dot net |
| Assigned | danielc |
| Status | Wont fix |
| Package | DB |
| PHP Version | 4.3.10 |
| OS | Linux/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!