1 Replies - 1503 Views - Last Post: 17 March 2013 - 07:04 AM Rate Topic: -----

#1 xuany  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 03-March 10

how to add record one after another ?

Posted 17 March 2013 - 06:51 AM

Dear all,

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.
include "connection.php";  // include this php file to connect the form with the db.
//ambil input dpd user
// $_POST[]; -- to capture the txt keyed in by user
		$sql = "INSERT into payment(id,date,type_fees,amount,receipt,membership)";
	 $result=mysql_query($sql) or die(mysql_error()); 
	 echo "Record saved";
	 echo "<br /> <META HTTP-EQUIV = 'Refresh' Content = '2; URL =search_member.php'>";	
      <!-- end .content -->

thank you.

Is This A Good Question/Topic? 0
  • +

Replies To: how to add record one after another ?

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3270
  • Posts: 11,545
  • Joined: 08-August 08

Re: how to add record one after another ?

Posted 17 March 2013 - 07:04 AM

First, learn to use prepared statements. Here's a great PDO tutorial.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1