Mysql_create_db() function is used to create a database. Usually, database is used in a application and it contains of some tables.
Using mysql_create_db() such as:
mysql_create_db("database");
Example, create a file named create.php within your localhost server. Enter following code:
<?php
//the example of making MySQL database
//create.php
$continued = mysql_connect("localhost","root","");
if($continued){
echo("Connection is succeed");
}else{
echo("Connection is fail");
}
$make = mysql_query("CREATE DATABASE data_root ",$continued);
if($make){
echo("<br><br>Database data_root succeeds in making");
}else{
echo("<br><br>Database data_root fails in making");
}
?>
Output:
0 comments:
Post a Comment