Just trying to work out how I should reference the database
if I am using objects. Currently the database needs to be
instantiated in the scope of the action server.
But if I'm calling a class and want to build an object I want
the object to populate all the data itself.
So how do I reference the database within the object I've
created when it performs various actions on the object ie
save, load etc.
All the examples I've seen using PHPMVC and ADODB
define the database within the scope of the action which
means I have to make the database a global variable and
then reference it within the object - not a pretty thing.
I'd like to simply call the methods on an object and let the
methods access a database reference.
Thanks
Andrew
Logged In: YES
user_id=662357
Andrew,
Do you mean something like this:
References relating to php.MVC/Database usage with Pear::DB
or ADOdb
Pear::DB database access in php.MVC
http://phpmvc.net/docs/guides/guidesIdx.php?doc=pear-db
ADOdb Database Access in php.MVC
http://phpmvc.net/docs/guides/guidesIdx.php?doc=adodb-db
John