Syntax:

mysql_connect(host name, user name, password);

mysql_connect() will get the correct value if it is succeed but false if it is fail.
 
Example
<?php
//the example of MySQL database connection
//connect.php
$continued = mysql_connect("localhost","root","");
if ($continued) {
echo ("Connection is succeed");
} else {
echo ("Connection is fail");
}
?>

0 comments:

Post a Comment

 
Top
Blogger Template