Jump to content

Customer Purchasing


Schlo_50

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
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.