I have this code to select and output 2 rows (fixed) from database into html form with hidden input
<?php
$sql = ("SELECT * FROM `prices`");
$query = mysql_query($sql);
while ($rows = mysql_fetch_array($query)) {
?>
<form method="post" action="process/save.php">
<input type="hidden" value="<?php echo $rows['Id']; ?>" id="offerid" name="offerid[]" />
<input type="hidden" value="<?php echo $rows['price']; ?>" id="offerprice" name="offerprice" />
<input type="hidden" value="<?php echo $rows['service']; ?>" id="offerservice" name="offerservice" />
<?php }; ?>
<input type="email" value="" id="customeremail" name="customeremail" placeholder="Enter Your Email Address" />
<input type="submit" class="button" value="Save Prices" >
</form>
and the save.php file is
<?php include("database.php");
$customeremail = mysql_real_escape_string($_POST['offerid']);
$offerprice = mysql_real_escape_string($_POST['offerprice']);
$offerservice = mysql_real_escape_string($_POST['offerservice']);
if(isset($_POST['submit'])){
$sql="INSERT INTO Save_Quote(Email, Price1, Service1, Price2, Service2,) VALUES ('// what comes here')";
$result="mysql_query($sql) or die (mysql_error())";
}
?>
how can i insert the values?
Any help will be much appreciated, Thank You.