Location: PHPKode > projects > XMasDB > xmasdb/lib/installdb.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<style type="text/css">@import url("../style.css");</style>
</head>
<body>
<h2>X-Mas Gift Database</h2><br><br>

<?php
include '../config.php';
include 'opendb.php';

$query  = "CREATE DATABASE ".$dbname."";
$result = mysql_query($query);

mysql_select_db("".$dbname."") or die('Cannot select database'); 

$query = 'CREATE TABLE gifts( '.
         'id INT NOT NULL AUTO_INCREMENT, '.
         'name VARCHAR(20) NOT NULL, '.
         'gift TEXT NOT NULL, '.
	 'got TEXT NOT NULL, '.
         'PRIMARY KEY(id))';

$result = mysql_query($query);

include 'closedb.php';
?> 

<?
include '../config.php';
include 'opendb.php';

$query = "INSERT INTO gifts (name, gift, got)".
         "VALUES ('Joe Bloggs', 'DVDs', 'Yes')";
mysql_query($query) or die('Error, insert query failed');

$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');

include 'closedb.php';
?>

<h3>DATABASE INSTALLED! NOW DELETE THE /LIB/INSTALLDB.PHP FILE!!!</h3>

<p align='center'><input type="button" class="btn" onClick="window.location='../index.php'" value="Login"></p>

</body>
</html>


Return current item: XMasDB