RE: [PHP] Classes - Dumb question
- From: jblanchard@xxxxxxxxxx ("Jay Blanchard")
- Date: Thu, 11 Oct 2007 10:25:07 -0500
[snip]
Not trying to hijack the thread... Hopefully this is related enough,
if not I apologize. Would a good use of a class be to write a generic
database connection script? and then feed in the different variables,
such as customer login, database, stuff like that?
something like class DBConnect {
// Connect to database
mysql_connect($server, $login, $password, $database);
}
or no?
[/snip]
I don't think so because it is inefficient...wrapping an existing stand-alone function is sort of redundant. If you were writing a database abstraction layer that would be a horse of a different color.
.
- References:
- Re: [PHP] Classes - Dumb question
- From: Jason Pruim
- Re: [PHP] Classes - Dumb question
- Prev by Date: Re: [PHP] Filter input
- Next by Date: Re: [PHP] FileZilla Password Decoder --- $i think therefore $i am
- Previous by thread: Re: [PHP] Classes - Dumb question
- Next by thread: Re: Classes - Dumb question
- Index(es):
Relevant Pages
|