Using Objects with Databases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I am trying to create a class, say User.  Each user has an entry in the database
table called user.  Each function, including the constructor, will be calling
the database to do something.  Is it better to initialize the database
connection inside each function or is it better to initialize the connection at
the beginning of the class?  What's the best practice on this?

Any help or example is appreciated.

Thanks,

Philip


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux