Hi,

We have created a database “trainee” in last program. Now we are going to create a table inside the database “trainee”. I am assume a table name is details and columns are Name, Father and Mobile, all are having the length 20. Ok Let us go to the program,

<?php
/* Create New Table */
$host = “localhost”;
$user = “root”;
$pass = “”;
$connect=mysql_connect($host, $user, $pass);
mysql_select_db(“trainee”); // Select your created database to create new table
$query=”create table Details(Name varchar(20), Father varchar(20), Mobile varchar(20))”;
$mysql=mysql_query($query);
if($mysql)
{
echo “New Table is created successfully”;
}
?>

OUTPUT:

New Table is created successfully