Jump to content

Creating Order Form


dennismonsewicz

Recommended Posts

I am working on a script for a client of mine that will allow their clients to select photos to order and then will submit the order so that an admin can go back in and look at the order. I am stuck on one thing. I don't know how to go about creating an order id. I need something that is tied to each entry in the database.

 

I thought about creating the order in the DB and then taking the created rowid and using it as the order id, but that doesn't seem efficient... any ideas?

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/208841-creating-order-form/
Share on other sites

Firstly, do you need to build this from scratch or would something like osCommerce: http://www.oscommerce.com/ suit you?

 

In any case, you need to create a separate table for orders presuming you already have a table for the photos that can be ordered.

 

The orders will have it's own auto-increment primary key just like the photos table. You'll be able to tie photos with orders by creating a second column in the orders table (orders.photoid). Each time an order is made the photo.id should be inserted into orders.photoid.

 

This way, you can reference the entries of the two tables with :

select * from orders, photo

where orders.photoid = photo.id

Link to comment
https://forums.phpfreaks.com/topic/208841-creating-order-form/#findComment-1090918
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.