access DB via PHP classes

From: Date: Tue, 08 Oct 2002 00:19:15 +0000
Subject: access DB via PHP classes
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-22259@lists.php.net to get a copy of this message
Hi All, Although I am not so new to PHP (not expert either), this is the first time for me to use PHP class. I am starting a project, and plan to use partially OOP and partially traditional programming. I use PHP/MySQL. I have one class, DB_Do, which does every thing to do with database, and several other classes. When I start my design, I realized that very often, other classes need to access database, eg. I have an "Access_Control" class which controls all accesses to pages in the application. One of methods in this class is to authenticate the user login via user name and password stored in the database. I am not sure if I should use an object of DB_Do within the method of Access_Control or write separate code to access the database for the user name and password. It seems that I loose purpose of OOP if I write the separate code. However, I am not sure if creating the object within other class is efficient? I would appreciate if some one there could give me some suggestions about this. Thanks in advance. Ruth

« previous php.db (#22259) next »