dioz20 0 Newbie Poster

Hello.

I'm currently coding a customer/product/etc registration site and there's this problem I just kinda can't figure out even after searching around on the web.

The DB consists of 8 tables

User (for login handling)
Customer (for customer registration)
Product (for product registration)
ProductCategory (for product category registration)
Cleaning (for cleaning ID/date registration)
CleaningRow (for the actual products/amounts that needs to be cleaned tied to the cleaning ID)
Billing (for... billing)
CustomerProductPrice (for individual price listing)

Anyway, enough about the background and let's move forth to the actual problem.

The problem I have is on the Receiving page, which handles the actual Cleaning/CleaningRow registration. First of all I have a listbox where the cashier selects the company name (from a listbox), date (provided automatically) and the representative name (textbox) of the company wanting the cleaning. After this is provided, he's supposed to click a submit button to store this along with generating a CleaningID. Afterwards, it's time to start filling out what kind of products, amounts etc to store in CleaningRow. To store this another submit button is clicked. Now, this is a problem since clicking the first submit button will submit the 3 things provided along with generating a CleaningID. But after that the whole form resets, and that's the problem. So my question is how do I keep the information from being erased when clicking the first button?

Right now it's looking like this for the Listbox containing the company names:

<div id='Listbox_container'>
                  <select name='Customer_Company_Name' id='Listbox' size='1'>
                  	<option value='Choose_Company'>V&auml;lj f&ouml;retag...</option>
					<br />
                  <?php

	$uname = "root";
	$upass = "xxxx";
	$server = "localhost";
	$table = "Customer";
	$database = "db";
	$column = "Customer_Company_Name";
	
	$db_handle = mysql_connect($server, $uname, $upass);
	if (!$db_handle)
	{
		die('Could not connect: ' . mysql_error());
	}
	$db_found = mysql_select_db($database, $db_handle);

	$result = mysql_query("SELECT $column FROM $table");

	while($row = mysql_fetch_array($result))
	{
		echo "<option value='{$row['Customer_Company_Name']}'>{$row['Customer_Company_Name']}</option>";
	}

	mysql_close($db_handle);
?>
                  </select>
               </div>

I just recently starting doing this a week ago or so - I have no previous experience with databases or programming in general. So if possible (i.e. you can be arsed) please explain to me in a simple way how to do it, but any help in pointing me in the right direction is appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.