i would like to insert a record, then after inserting the record, it show in the table, then i can add another record. Just like what we fill in a form about our Academic qualification.
first we fill in the diploma level, then we add another record of degree level, then postgraduate level and then PHD level.
my code is as below, but it only insert one row, how do i continue with second row and so on.
<?php
include "connection.php"; // include this php file to connect the form with the db.
//$getId=$_GET["id"];
$getId=mysql_real_escape_string($_GET['id']);
//ambil input dpd user
// $_POST[]; -- to capture the txt keyed in by user
$date=mysql_real_escape_string($_POST["date1"]);
$type_fees=mysql_real_escape_string($_POST["lstfees"]);
$amount=mysql_real_escape_string($_POST["txtamount"]);
$receipt=mysql_real_escape_string($_POST["txtreceipt"]);
$sql = "INSERT into payment(id,date,type_fees,amount,receipt,membership)";
$sql.="VALUES('','$date','$type_fees','$amount','$receipt','$getId')";
$result=mysql_query($sql) or die(mysql_error());
echo "Record saved";
echo "<br /> <META HTTP-EQUIV = 'Refresh' Content = '2; URL =search_member.php'>";
//header("location:register_payment.php?id=$row[id]");
?>
</p>
</div>
<!-- end .content -->
</body>
</html>
thank you.

New Topic/Question
Reply




MultiQuote





|