PEAR is archived and read-only

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

Home » Database » DB_DataObject » Bug #9903

Column names containing spaces are not handled properly

Details

Submitted2007-01-21 20:13 UTC
Fromdavid dot ward at gatech dot edu
StatusDuplicate
PackageDB_DataObject
PHP VersionIrrelevant
OSWindows XP
Roadmaps(Not assigned)

Comments

[2007-01-21 20:13 UTC] david dot ward at gatech dot edu

Description:
------------
Table names that contain spaces and other special characters are handled properly, through the use of code like the following (DataObject.php line 2554):

$class = $p . preg_replace('/[^A-Z0-9]/i','_',ucfirst($table));

However, spaces in column names are not being handled properly. For example, DB_DataObject_Generator::_generateClassTable() returns output like this:

###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */

var $__table = 'Students'; // table name
var $Last Name; // varchar(25) not_null

The solution should be nearly identical to that for table names (the preg_replace example mentioned above), if it is applied wherever a column member variable of a DB_DataObject is referred to.

[2007-01-22 14:05 UTC] powtac at gmx dot de

Same as: http://pear.php.net/bugs/9839