PEAR DB: escaping column names with autoExecute
| From: | Gerry Demaret | Date: | Wed, 04 Jun 2008 14:15:49 +0000 |
| Subject: | PEAR DB: escaping column names with autoExecute | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-28967@lists.php.net to get a copy of this message | ||
Hello,
In a piece of code that relies heavily on PEAR DB and it's autoExecute
feature, I am encountering a problem with database field names
containing dots.
I can not change the field names (sadly), and I would really not like to
drop PEAR DB's autoExecute functionality here.
What it's generating is the following query (shortened for readability):
UPDATE tablename SET id = '13', dns_in.mx = 'mx',dns_relay.mx = 'relay' WHERE id='13' [nativecode=1054 ** Unknown column 'dns_in.mx' in 'field list']
As you see, PEAR DB does not escape the column names, whereas it is
mandatory here. Anyone any hints on this?
Kind regards,
Gerry.