PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_QueryTool » Bug #4613

Table Names Not Quoted

Details

Submitted2005-06-16 19:34 UTC
Frommulka at umich dot edu
Assignedquipo
StatusClosed
PackageDB_QueryTool
PHP Version4.3.5
Roadmaps(Not assigned)

Comments

[2005-06-16 19:34 UTC] mulka at umich dot edu

Description:
------------
Table names appear not to be quoted with ` (the backtick I think it is called.)

This should be an easy fix.

The reason I need it quoted is because I have a table named "Fields" but FIELDS is a reserved word in MySQL and the query that the DB_QueryTool is generating gives me an error when I try to run it.

Reproduce code:
---------------
<?php
require_once "DB/QueryTool.php";

$qt =& new DB_QueryTool();

$qt->setTable('Fields');

print $qt->getQueryString();
?>

Expected result:
----------------
SELECT * FROM `Fields`

Actual result:
--------------
SELECT * FROM Fields

[2005-06-16 19:36 UTC] mulka at umich dot edu

Actually... I think all fields, table names, etc should be quoted in the appropriate syntax.