RE: Classes - Dumb question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux