Login

Username:

Password: 

Join us Now |  Forgot Password? | Forgot UserName?

PHP

Learn step by step



MySql Connect

mysql_connect () where it is used to do the connection to MySQL database program.
Syantax:
mysql_connect(host name, user name, password);
Mysql_connect() will get the correct value if it is succeed but false if it is fail

<?php
//the example of MySQL database connection
//connect.php
$continued = mysql_connect("localhost","root","admin");
if ($continued) {
echo ("Connection is succeed")
} else {
echo ("Connection is fail")
}
?>

Create a file and save it connect.php and write in browser localhost/foldername/connect.php you see
Connection is succeed



Related Videos