<?php
$host='localhost';
$user='root';
$pass='';
$conn=mysqli_connect($host,$uAser,$pass);
if(!$conn)
{
die('Could not connect : '.mysqli_connect_error());
}
echo "Connect successfully</br>";
$sql = 'CREATE DATABASE mydb';
if(mysqli_query($conn,$sql))
{
echo "Database mydb created successfull";
}else{
echo "Sorry, database creation failed ".mysqli_error($conn);
}
mysqli_close($conn);
?>
$host='localhost';
$user='root';
$pass='';
$conn=mysqli_connect($host,$uAser,$pass);
if(!$conn)
{
die('Could not connect : '.mysqli_connect_error());
}
echo "Connect successfully</br>";
$sql = 'CREATE DATABASE mydb';
if(mysqli_query($conn,$sql))
{
echo "Database mydb created successfull";
}else{
echo "Sorry, database creation failed ".mysqli_error($conn);
}
mysqli_close($conn);
?>
No comments:
Post a Comment