phpLens
 home  products examples manual  faq support forum  contact news  login store

Forums: phplens   adodb
Forums:   ADOdb Help & Dev:   Replies 
Search
Topic: BUG: Active Record will set variables with spaces to match column names
author: Daniel Cook   created: 08-01-2008 11:32:22 AM
I am using a precreated database table that has spaces in the column names, Active Records kicks back these variables with the spaces in them. It should change the spaces to underscores so the variables can be called.

I overrode _set($name, $value) as a work around:

public function __set($name, $value)
{
$name = str_replace(' ', '_', $name);
$this->$name = $value;
}

i realize you could call it with something like:
$aObject = new ActiveRecordObject();

$var = 'a variable';

$value = $aObject->$var;

but it is rather cumbersome and should be avoided.
Topic: Re:BUG: Active Record will set variables with spaces to match column names
author: John Lim   created: 10-01-2008 00:45:19 AM
Good idea! Added
Page 1
Search

View Source

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800