RE: [PHP] Classes - Dumb question



[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.
.



Relevant Pages

  • Re: Missing file from MS.NET Compact Framework Kick Start
    ... let apologize for the missing files in our samples. ... The readme.txt file from Chp 9 in describes how to set up the test database ... is a sql script file that will set up the Quotes database on the server. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Bypass Password Box in XP??
    ... I apologize to all for not searching the database ... before I sent this request. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Simple update quesion
    ... considerable typing. ... I guess what I am trying to say is with a form can I display the last record ... database as record 2 ... I apologize if this is too trivial. ...
    (microsoft.public.access.forms)
  • Re: My apology to Leo
    ... > I apologize for my recent comments about your fine database, ... It was inappropriate for me to refer to minor ... > anything on the newsgroup. ...
    (soc.genealogy.medieval)
  • Re: PQService Error
    ... "hijack" wrote in message ... applications log, approximately every ten minutes from 7:30 AM this morning. ... There was an error opening the database: ...
    (microsoft.public.windows.server.sbs)