Schlo_50 Posted December 5, 2007 Share Posted December 5, 2007 Hello, Im basically posting here because i need some help in a little project that i have. I am using a database to store items for customers to purchase. Basically i need a way of printing/echoing out all of the items in the database in some kind of form format so that when a user wishes to place an order they can. The website doesn't actually do any payment processing. So could somebody show me how to get the products page to display the items ordered by category and send any item the user selects to buy into the database in orders_tbl. I have code to establish a connection to the database but have no idea how to echo out the results in a form with checkboxes next to each item and then grab selected items and put them into the database. In my products table i have: CategoryName ProductId, ProductName, and Price Products.php so far: <?php include('../odbc/odbc.php'); ?><head> <title>Products</title> </head> <body> <form name="the_form" id="the_form" method="post" action="<?php $_SERVER[php_SELF]; ?>"> <?php $sql2 = odbc_exec($odbc, "SELECT * FROM Product1 ORDER BY CategoryName") or die (odbc_errormsg()); I hope this is enough information, anything missing then please ask! Thanks for reading and any help or snippets posted! Quote Link to comment https://forums.phpfreaks.com/topic/80286-customer-purchasing/ Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 Kinda asking a lot. There are quite a few books and tutorials on this type of script. Quote Link to comment https://forums.phpfreaks.com/topic/80286-customer-purchasing/#findComment-406894 Share on other sites More sharing options...
Schlo_50 Posted December 5, 2007 Author Share Posted December 5, 2007 Links to tutorials welcomed. Im not afraid of reading, and i have googled. I just haven't found any on google that are very specific to what i need, im not using MySQL either! Quote Link to comment https://forums.phpfreaks.com/topic/80286-customer-purchasing/#findComment-406896 Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 You'll need two more tables. Order table and Customer table. Then you'll want to link the Customer ID with a column in the order table that has a Customer ID column along with a Order ID and link that in there as well. You'll need to do some type of Join to get the info you need, and I'm not sure how you can do that with Access. Quote Link to comment https://forums.phpfreaks.com/topic/80286-customer-purchasing/#findComment-406907 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.