Re: DB_DataObject FormBuilder
| From: | David Thunman | Date: | Sat, 06 Mar 2004 10:44:10 +0000 |
| Subject: | Re: DB_DataObject FormBuilder | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11127@lists.php.net to get a copy of this message | ||
Hi Moritz,
I am afraid not since you hardly write any mysql statements using this library. Even less performing queries on related tables. It is very difficult (at least it seems so) to create a custom sql query as you would using a less complex DB class. Only with its parent class, DB_DataObjects, which is real great. I can write my sql using this class, but then it is like i am issuing the same command twice (at least), and that is not efficient code.
David
2004-03-06 kl. 10.36 skrev Moritz Heidkamp:
Hi David, I have never used DB_DataObject FormBuilder but maybe you could use the mysql function CONCAT within your SELECT query (if you use mysql, of course but there will be similar functions in other DBs)? Like that: SELECT table.ID, CONCAT(table.lastname, ' ', table.firstname) FROM ... Regards, Moritz David Thunman wrote:Hello, After much work with the DB_DataObject FormBuilder class, I start to enjoy working with it. I see there are still many fixes to be made, but I like the feature of the related tables select menu creation so much I just can't go back to something else. Now I bumped in to a problem creating select menu items where I want the label text of an option to be built up from two different cell values in the related table. In my case they are "tablename.last_name" and "tablename.first_name" ehich I#d like to concatenate into one string. By default, I think, the formbuilder class uses the first collumn after the primary key from the related table to create the option label text(?). Is there an easy way to define this in an ini file or do I have to hack the formbuilder.class file to for this? Thanks, David Thunman-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php