Hi, I want to go create a table with a textfield where the user can
enter an amount for a certain dynamically created article coming from
the database.
Later, I want to calculate the whole price and so on.
It works nicely to create my multi dimensional array,
however, it does not work to save the values coming from the form to
calculate the price.
What's wrong???
<form name="shop" method="post" action="index.p hp">
$articleTable = array();
while ($row = mysql_fetch_arr ay($result)) {
$articleNr= $row["articleNr"];
$name= $row["name"];
$picName= $row["picName"];
$price = $row["price"];
$amount="";
$articleRow = array(
"articleNr" => $articleNr,
"name" => $name,
"picName" => $bildName,
"price " => $price ,
"amount" => $amount
);
array_push($art icleTable , $articleRow );
}
foreach($articl eTable as $article) {
?>
<input type="text" name="article[amount]" size="2" maxlength="2"
value="<? $article[amount] ?>"></td>
}
<?
}
?>
</form>
enter an amount for a certain dynamically created article coming from
the database.
Later, I want to calculate the whole price and so on.
It works nicely to create my multi dimensional array,
however, it does not work to save the values coming from the form to
calculate the price.
What's wrong???
<form name="shop" method="post" action="index.p hp">
$articleTable = array();
while ($row = mysql_fetch_arr ay($result)) {
$articleNr= $row["articleNr"];
$name= $row["name"];
$picName= $row["picName"];
$price = $row["price"];
$amount="";
$articleRow = array(
"articleNr" => $articleNr,
"name" => $name,
"picName" => $bildName,
"price " => $price ,
"amount" => $amount
);
array_push($art icleTable , $articleRow );
}
foreach($articl eTable as $article) {
?>
<input type="text" name="article[amount]" size="2" maxlength="2"
value="<? $article[amount] ?>"></td>
}
<?
}
?>
</form>
Comment