Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Request #2616 Add quiteIdentifer() from MDB2 to MDB
Submitted: 2004-10-25 18:25 UTC
From: justin at koivi dot com Assigned:
Status: Closed Package: MDB
PHP Version: 4.3.9 OS: All
Roadmaps: (Not assigned)    
Subscription  


 [2004-10-25 18:25 UTC] justin at koivi dot com
Description: ------------ Using MySQL, if I have a query like: SELECT option FROM table1 No error is reported by the MDB MySQL driver that I could see... (I tried a var_dump of the object as well as checking the getMessage method). The only thing that MySQL reports is: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION FROM table1' at line 1 Since OPTION is a key word, that would be expected, and if I put OPTION between back ticks, the error is resolved (for MySQL anyway). MDB needs to have an auto-delimiting feature for queries. MDB2 already has quiteIdentifer() (as reported from Lukas) that should be added to MDB.

Comments

 [2004-10-25 18:28 UTC] smith at backendmedia dot com
You can see how it will work here: http://pear.php.net/manual/en/package.database.db.db-common.quoteidentifier.php so its not really automatic ...
 [2004-10-25 18:43 UTC] justin at koivi dot com
Looks like it will work perfect for what I was thinking of using it for. Thanks for the link.
 [2004-10-26 21:27 UTC] smith at backendmedia dot com
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/MDB Ups. I actually already added this method to the last release (1.3.0)