Accessing Mysqli From Different Class
View Single Post
08-24-2009, 09:43 AM
Join Date: May 2009
for info - i ended up creating a singleton select pattern for db access. Using a static method check if an object has already been instantiated and if not then instantiate one.
I also extended the mysqli PHP delivered class to add a lot of extra functionality like class methods to start transactions of work, force rollbacks etc and also added a debug property so if its set to True i throw exceptions spilling out a lot of debug info and if False i throw a generic "having technical difficulties" exception.
Reason I mention is I am using the same approach as yourself and found extending the mysqli class incredibly useful.
View Public Profile
Send a private message to captainmerton
Find More Posts by captainmerton