If you're going to the trouble of making an authentication class, you should
consider also using a database connection class, and modifying your
authentication class to make use of it.  You might want to roll your own,
although there are numerous classes that already exist.  

As for "portability" I'm not a big fan of designing for it where databases
are concerned.  People always talk about portability, but how often do they
move applications from one database to another?  The reality is relational
databases have many differences, and many different contention and locking
schemes.  I firmly believe in using the best features available in any
database I'm developing for.  

With that said, adodb is a well known database portability library that has
been around for a long time and been used in many projects.  I personally
like the simplicity of ez_sql which can be found here:
http://www.justinvincent.com/

-----Original Message-----
From: rogue [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 12, 2004 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] class design question

hi there.

i am working out the finishing touches on a authentication class that 
uses mysql to store the time of last access and some other goodies.

my question is, when developing a class that uses a database, what is 
the best way to handle the database bit? for now i just set the 
connection in an .inc file and include that in the class, but there has 
got to be a better way - especially for portability sake.

thanks for any suggestions.

- rogue

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

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

Reply via email to