CMS takes the work out of building interactive websites.

Create a website at Omnis Network using Joomla, PostNuke or other popular software.

$5.95 Web Hosting
Installs instantly using the FANTASTICO script installer!!

Your site will have automatic features like member sign up and site search.

Features like message boards and chat are easily added.

PHP MySQL
Interactive Website Design

Creating a Table

A database will contain a variable number of tables of data which are arranged in columns and rows. Each table is supplied with a unique name upon creation. Variables contained within the table are supplied with definitions for type and length.


CREATE TABLE birthdays( id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
name VARCHAR(30),
birthday VARCHAR(7));

In the example shown above, we create a table named birthdays.

The table contains 3 columns:
a primary key field called id which will be automatically incremented each time a record is added.
a name field which will contain a variable number of characters up to 30
a birthday field which will contain a variable number of characters up to 7.

<?
$db="mydatabase";
$link = mysql_connect("localhost");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Select DB Error: ".mysql_error());
//create table
mysql_query("CREATE TABLE birthdays( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), birthday VARCHAR(7))")or die("Create table Error: ".mysql_error());
mysql_close($link);
?>

In the example code shown above, before the table can be created, the database must first be selected using the code:
mysql_select_db($db , $link)

Download the Scripts

The Birthdays Database management files can be downloaded in a zip file. The package contains an integrated db management system, with a simple login file and interface. To run the scripts on your PC you must have a localhost server installed along with PHP and the MySQL server.
Download birthdays_db.zip

MySQL Tutorial

To extend your knowledge of MySQL study the Docs and Tutorials at the official MySQL website. MYSQL.com

Create a database Top Recommended $5.95 Hosting Add a record
PHP MySQL is a service provided by Net Success 2000 Plus Inc
PO Box 1508
Somerset, KY 42502
Last Modified: July 2, 2007

| HTML TOC | Web Design | Create a Website |

PHP MySQL - Interactive Website Design Copyright © 2007