how to insert data into two table using one single query in php mysql? my table name are popup_question and popup_answer . popup_answer table has multiple row and i went to insert multiple row on the table popup_answer and popup_question . popup_question does not have multiple row. please help me. my code is bellow
thank's
include('config.php');
session_start();
$msg="";
if(isset($_POST['h_action']))
{
$val_h_action=$_POST['h_action'];
}
if(isset($_POST['h_id']))
{
$val_h_id=$_POST['h_id'];
}
if($val_h_action=="delete")
{
mysql_query("DELETE FROM popup_question WHERE Id='$val_h_id'");
mysql_query("DELETE FROM popup_answar WHERE Question_id='$val_h_id'");
thank's for ur help .but i just use one php form and this form have some input field and this input field value insert into a table i.e (popup_question) and this form have some another field like mulple answer option and i just given input value for this field like option a. 25, b.27, c.28 using add row button .and this value insert into a another table(popup_answar). please run my code is your own system then you understand my problem . i am use two table popup_question and popup_answar. and my database name is new_uk_crm.
Posted May 28, 2015, 4:11 AM
Upendra Pratap ShahiPosted May 28, 2015, 3:54 AM