dennismonsewicz Posted July 25, 2010 Share Posted July 25, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/208841-creating-order-form/ Share on other sites More sharing options...
webmaster1 Posted July 25, 2010 Share Posted July 25, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/208841-creating-order-form/#findComment-1090918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.