I have a problem. Im using a while loop. I placed a inside the query $rows['price']. How do I submit the entire inserted values inside the loop to a table?. It has 5 results.
page1.php
<?php
$sql = mysql_query("SELECT id FROM table where id = '$ID'");
while($row = mysql_fetch_assoc($sql)){
echo '<form action = "page2.php" name = "add" method = "post">';
echo "<b>Price:</b> ";
echo '<input size = "1" type="text" name="price" value = ""/>';
echo "%";
echo "<br/>";
}
?>
<input type="submit" name="price" value="SUBMIT"/>
</form>
The output would be like this.
Price: __ % Price: __ % Price: __ % Price: __ % Price: __ % |SUBMIT|
page2.php
<?php
if(isset($_POST['submit'])){
$price = $_POST['price'];
mysql_query("INSERT INTO items_tbl(price) VALUES('$price');
?>
Somehow it worked a little. I inputed values in the form from 90,80,70,60,50. But the only one inserted in the table is the last, at the bottom (50). The rest dont.