Development of Interactive Web Pages 62-11
62.5.3 Creating a Database
To create a database on MySQL, use the CREATE DATABASE statement.
Example:
<?php
$contn=mysql_connect("localhost","username","password");
mysql_query("CREATE DATABASE employeeinfo",$contn);
?>
62.5.4 Creating a Table
To create a Table, use the CREATE TABLE statement.
Example:
<?php
//Establish connection to MySQL database.
$contn=mysql_connect("localhost","username","password");
//Create your database
mysql_query("CREATE DATABASE employee",$contn);
/*Select your database or for the matter, you can select any
database that you have already created.*/
mysql_select_db("employee", $contn);
// Create table
$tbl = "CREATE TABLE employeeinfo
(
LastName varchar(15),
FirstName varchar(15),
Department ...