The INSERT command is used to enter new information into a database. A common way to gather information is using a form.


Once the SUBMIT button is clicked on, the information entered will pass over to the "enter_it.php" page through the $_POST[ ] variable.


To explain the new coding snippit:

We are using a variable $query to contain the command information we want to perform. This keeps our coding easy to maintain.

INSERT INTO prepares the database for new incoming data. address_book is stating which table is going to receive the new information and what columns (by name) will be affected.

The VALUES of the following variables contain the new information to be entered into the specified columns.

IF the following value is not true, the script will stop (die) and print out the error.

mysql_db_query is a command used to perform the actual insert command. it uses the database name, query command, and server link to make it all happen.

Table of Contents