Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.