connection string (php to mysqli) and select Database

<?php
error_reporting(E_ALL);
// Create connection
$con = mysqli_connect("localhost","root", "");
//$con = mysql_connect("servername","username","password");

if (!$con) {
    die('Could not connect: ' . mysql_error());

}  else {
mysqli_select_db($con, 'p_project');
//mysqli_select_db($con, 'database_name');
}
?>


No comments:

Post a Comment