Location: PHPKode > projects > ezBook > ezbook/ezbook-install.php
<?php 
    mysql_connect ("localhost","root","") or die ("Cannot connect to the SQL server.");	// Connecting to the database server
    mysql_create_db ("ezBook") or die ("Cannot create database.");    					// Creating the database
    mysql_select_db ("ezBook") or die ("Cannot select database.");						// Selecting the database
	
    $Query   = "CREATE TABLE GuestTable (";											// Creating the table
    $Query  .= "  Id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY,";
    $Query  .= "  Name VARCHAR(40),";
    $Query  .= "  Email VARCHAR(40),";
    $Query  .= "  Date TIMESTAMP(8),";
    $Query  .= "  Comment TEXT";
    $Query  .= ");";

    mysql_query ($Query) or die ("Cannot create table."); 

    $Query  = "INSERT INTO GuestTable (Name, Email, Date, Comment) ";				// Inserting the initial values
    $Query .= "VALUES ('Webmaster', 'hide@address.com', NULL, 'Please leave your comments and suggestions.')";  // Feel free to change the values as appropriate
    mysql_query ($Query) or die ("Insert Failed!");

    echo ("ezBook has been successfully installed.");
?>
Return current item: ezBook