PHP creating a tracking number

I am doing a student project and I am creating a webpage for a fictional company. I am trying to create an order tracking number and a list of everything ordered when “submit” is clicked. The order tracking number and the list of items will be shown on the “get order” page". I haven’t had any database training from my school, we were suppose to magically know this I guess. Here is my code can anyone help on what I need to add to get my desired results.

Order page

<?php include("header.php"); ?>
TRADITIONAL

12 Chocolate Chip Cookies in a box

<?php include("footer.php");?>

Tracking number and listed items page code

<?php include("header.php"); include ("connection.php") ?> <?php $insert = mysql_query("INSERT INTO order_tracking ") ?> <?php include("footer.php");?>

I assume with an order tracking number you mean an unique identifier for that order.

The way I’d do it is make sure you have an ‘order’ table in the database. Give it an auto-increment key-column and name it ‘ordernumber’.
When you add a new record to this table the ‘ordernumber’ column will always contain an unique value, so this is ideal for your order tracking number.
Depending on what database you use there are ways to retrieve this identifier when you add (insert) the record in the database. ( There is a quite elaborate section in the PHP documentation on this, especially MySQL seems to be well-integrated into PHP )

I hope this helps a little.

BTW, What I see is a webpage that submits an empty form and separate of that an image and a description of a product.

( PS, why do you include the footer outside the body element? )

Sponsor our Newsletter | Privacy Policy | Terms of Service