Home > DeveloperSection > Forums > Connection in PHP
Amit Singh

Total Post:103

Points:721
Posted on    October-18-2010 10:22 AM

 PHP PHP 
Ratings:


 0 Reply(s)
 1363  View(s)
Rate this:
Connection in PHP we use this code:

<?php
//Start PHP statement
$link 
mysql_connect('localhost''mysql_user''mysql_password'); //this is the MySql connection function with passing parameter

if (!
$link) {
 die(
'Could not connect: ' mysql_error()); //this is show the connection error
}
echo 
'Connected successfully'; //It show the message connection successfully or not
mysql_close($link); //connection close here
?> //End PHP statement


Don't want to miss updates? Please click the below button!

Follow MindStick