Re: Re: DB_DataObject
| From: | Noel da Costa | Date: | Thu, 10 Aug 2006 10:21:51 +0000 |
| Subject: | Re: Re: DB_DataObject | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24875@lists.php.net to get a copy of this message | ||
It seems that the problem is that I'm putting spaces into the "AS" name... which breaks the DataObject.
"SELECT person.person_id, person.firsrtname AS
First Name, person.lastname FROM person".. which works fine if I run it directly on MySQL
But the dataObjects being returned all contain both these properties (and both are empty):
"firstname"
"First Name"
If I change it to "First_Name" then it works fine.
On a slight tangent...
I'm using DB_DataObject 1.7.15 (an old version). I tried the new version (in an attempt to sort out the above problem) but all my applications crashed with the following error:
DB_DataObject Error: Unable to load schema for database and table.
It looks like the reason is because I don't have a "links file" - which I didn't need before and don't want to use. I think the idea of a links file is cumbersome and I was doing fine without it... is it required in the new version of DB_DataObject?
I also notice that DB has been superseded by MDB2 - does the latest version of DB_DataObject make use of MDB2? Any gotchas?
Thanks,
Noel
On 10 Aug 2006, at 09:30, Alan Knowles wrote:
Noel da Costa wrote:Noel da Costa Lead Developer noel.dacosta@magharl.co.ukHi, A query regarding the use of custom ->selectAdd statments with DB_DataObject: If I use this:Are you sure that SQL is correct - it should be "column1 AS Name" or $DB = $DO->getDataBaseConnection(); "column1 AS ". $DB->quoteIdentifiers('Name') Regards Alan$DO->selectAdd(); $DO->selectAdd("column1");I get a dataobject containing a ->column1 property with valid data. However, if I use this:$DO->selectAdd(); $DO->selectAdd("column1 AS 'Name'");The data object that returns contains a ->column1 property which is empty and a ->Name property which is also empty. Why? How can I fix? Any ideas? Thanks, Noel Noel da Costa Lead Developer noel.dacosta@magharl.co.uk--PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___________________________________________________________________ This message has been scanned by the Datanet MessageScreen Service. For more information please visit http://www.MessageScreen.co.uk