Tuesday 9 August 2016

how to create php mysql connection with object

<?php
$host ='localhost';
$username ='username?';
$password ='password?';
$db = 'databasename?';
$con = new mysqli($host, $username, $password, $db);
if(mysqli_error($con))
{
printf("Connect failed %s\n",mysqli_connect_error());
}
?>

No comments:

Post a Comment