All Vskills Certification exams are ONLINE now. You may take from any where any time | Please use #TOGETHER for 20% discount

Certified PHP Developer Learning Resources Database Connection

Database Connection
 


The first job is to actually connect to database like MySQL. As it's name suggests, mysql_connect( ) does exactly that. The example code is as -

$user_name = "root";
$password = "";
$database = "addressbook";
$server = "127.0.0.1";
mysql_connect($server, $user_name, $password);
print "Connection to the Server opened";
?>

 

The predefined objects:

mysql_connect: Open a connection to a MySQL server.