Hello,
I have three tables in MySQL database which they are: employee, expenses and details. The details table is composite table between the expenses and employee. In the HTML form there is a table that will enter multiple data into details that will referenced with one expenses id. I could only insert one values from the row and did not insert the second row values. Could anyone help me or suggest a solution for me.
$exp_id = mysql_insert_id();
$query2 ="INSERT INTO expenses_claim (claimant_date,total_bd) VALUES (now(), '$total')";
$result = mysql_query ($query2,$connect);
$last_insert_exp_id = mysql_insert_id();
$query3 = "Insert INTO details (exp_id, emp_no, manager_no, exp_desc, amount, foreign_currency, exch_rate, BD) VALUES ('$last_insert_exp_id','$emp_no','$manager_no','$exp_desc1','$amount1','".$_POST['select']."','$exch_rate1', '$bd1')";
$result1 = mysql_query($query3,$connect);