Re: Re: DB_DataObject

From: Date: Fri, 11 Aug 2006 04:55:01 +0000
Subject: Re: Re: DB_DataObject
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24887@lists.php.net to get a copy of this message
Noel da Costa wrote: > 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" Can you file that as a feature request - first fetch check to see if column names are valid -> if not throw a fatal error... * A patch would be nice ;) > > 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. Can you try CVS, and if that problem still exists, file it as a bug. > > 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? I've not personally tested it, but using db_driver=MDB2 should work as far as I know. Regards Alan > > Thanks, > Noel > > > > > On 10 Aug 2006, at 09:30, Alan Knowles wrote: > >> Noel da Costa wrote: >>> Hi, >>> >>> A query regarding the use of custom ->selectAdd statments with >>> DB_DataObject: >>> >>> If I use this: >>> $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'"); >> Are you sure that SQL is correct - it should be "column1 AS Name" >> or >> $DB = $DO->getDataBaseConnection(); >> "column1 AS ". $DB->quoteIdentifiers('Name') >> >> Regards >> Alan >> >> >> >>> >>> 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 yJï½`ëâ*sŠ 7Ÿ >> ýÒhttp://www.MessageScreen.co.uk >> >> > > > > Noel da Costa > Lead Developer > noel.dacosta@magharl.co.uk > > > >

« previous php.pear.general (#24887) next »