php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65757 Please implement quote_identifier() method as done in Perl's DBI.
Submitted: 2013-09-25 07:22 UTC Modified: 2013-09-25 22:12 UTC
From: cmanley at xs4all dot nl Assigned:
Status: Duplicate Package: PDO related
PHP Version: 5.4.20 OS:
Private report: No CVE-ID: None
 [2013-09-25 07:22 UTC] cmanley at xs4all dot nl
Description:
------------
---
From manual page: http://www.php.net/pdo.quote#refsect1-pdo.quote-seealso
---

Besides the quote() method, a quote_identifier() method would be very helpful for quoting table and field names. This method exists in Perl's DBI:
http://search.cpan.org/dist/DBI/DBI.pm#quote_identifier

Basically emulate this MySQL specific method for each driver:

public function quote_identifier($value) {
    return '`' . str_replace('`', '``', $value) . '`';
}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-25 22:12 UTC] aharvey@php.net
-Status: Open +Status: Duplicate
 [2013-09-25 22:12 UTC] aharvey@php.net
Duplicate of request #38196.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 16:01:29 2024 UTC