Wednesday, 29 July 2015

mysqli Connect to database

<?php
$db_conx = mysqli_connect('localhost', 'root', '', 'boe');
// Evaluate the connection
if (mysqli_connect_errno()) {
    echo mysqli_connect_error();
    exit();
}
?>



/*
here localhost is a host name , root is user and boe is database name
echo mysqli_connect_error();
will show you error while connecting database if error occur 
*/

No comments:

Post a Comment