Saturday, February 24, 2007

Mysql connect Function

//
function connect_db($localhost,$user,$password,$database)
{
mysql_connect($localhost,$user,$password);
mysql_select_db($database);
}
//

You use the mysql_connect function and the mysql_select_db function at the same time in 1 new function created by you. Saves up a few seconds of your time. ;)
So actually, you just call 1 PHP function:
< ?php connect_db("localhost","username","password","database") ? >
and VOILA!!! you are connected to your database!

Technorati Profile

1 comment:

Admin said...

You are linked to
http://undim.blogspot.com
and
http://aboutoracle.blogspot.com