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

Inserting Data into a Table

The basic SQL syntax is placed within the mysql query function statement.

mysql_query ();

The SQL syntax is enclosed in double quotes. It supplies the command , the name of the table, the field names and the values to be added.

"INSERT INTO birthdays (name, birthday) VALUES ('Peggy', 'June4')"

The mysql_query function can be used in many other database operations.

The code for adding data to a table is shown below.

The first example (red) shows the actual VALUES which are added.

The second (blue) shows how to add data parsed from a simple form.

<?
$name=$_POST['name']; $birthday=$_POST['birthday']; $db="mydatabase";
$link = mysql_connect("localhost");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
mysql_query ("INSERT INTO birthdays (name, birthday) VALUES ('Peggy', 'June4')");
mysql_query ("INSERT INTO birthdays (name, birthday) VALUES ('$name','$birthday')");
mysql_close($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 table Top Recommended $5.95 Hosting Display data
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