Re: MySQL to OO
| From: | John Holmes | Date: | Thu, 16 Sep 2004 12:44:08 +0000 |
| Subject: | Re: MySQL to OO | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196853@lists.php.net to get a copy of this message | ||
From: "Neo Theone" <neotheone@gmx.net>
I am looking for a absolute transparent interface to access each field a s a object. [snip]I am searching for a MySQl to Object abstraction class. I am thinking something like WebObjects does in Java (it is just a part) in PHP. I had one for Ruby but now I have to use a DB in MySQL and such a class would make it alot easier.Are you talking about accessing MySQL using an OO interface or receiving results/schema/etc in an OO format?
I could access it like this: namedtable->return() would give me the whole table namedtable->id(all) would give me [01, 02] namedtable->id(01) would give me [foo=>aaa, bar=>uuu]PEAR or ADOdb (along with other abstraction layers, I'm sure) will create an interface like that for you for a RESULT SET, i.e. the result of a query. It'd be pretty wasteful to interact with an entire table that way (although you could just do "select * from table" to simulate it, I guess). Search google for the PEAR::DB and ADOdb manual pages and look into it. ---John Holmes...