I am trying to insert multiple variables into a database and am not real sure what I am doing wrong......here is some background to what I am doing.
I am trying to write a page that will allow me to enter sales values for a multiple number of accounts. Following is the code that I use on my input page.....
On my second page, processSales.php, how do I input all of the values of these variables that are posted to that page........
thanks for your help
I am trying to write a page that will allow me to enter sales values for a multiple number of accounts. Following is the code that I use on my input page.....
Code:
<?php
// Set the variables for the database access:
$Host = "localhost";
$DBName = "db_name";
$TableName = "accounts";
$Link = mysql_connect ($Host, $User, $Password);
$Query = "SELECT * from $TableName ORDER BY accountname";
$Result = mysql_db_query ($DBName, $Query, $Link);
print ("<form name=sales action=processSales.php method=POST>");
// Fetch the results from the database.
while ($Row = mysql_fetch_array ($Result)) {
echo "<br><b>$Row[accountname]</b>";
print ("<input type=hidden name='$Row[accountname]account' value='$Row[accountname]'>");
print (" <input type=text name='$Row[accountname]salesvalue' value='Input Sales'>");
print (" <input type=text name='$Row[accountname]waste' value='Input Waste'>");
print (" <input type=text name='$Row[accountname]inv' value='Input Inventory'>");
print (" <input type=text name='$Row[accountname]hours' value='Input Hours'>");
print (" <input type=text name='$Row[accountname]salesdate' value='Input Sales Date'>");
}
print ("<br><br><br><input type=submit name='Add Sales'>");
print ("</form>");
?>
On my second page, processSales.php, how do I input all of the values of these variables that are posted to that page........
thanks for your help