Here is PHP Code where data is inserted in database
function addOnlineUser($PostApply,$name,$fathername,$email,$dob,$Uniq_Id,$age_on_year,$age_on_month,$age_on_day,
$ImgVal, $subBoard, $subPassYear, $subHigherQ ,
$Exservice,$Ex_Served, $Ex_yr, $Ex_mon, $Ex_day, $Designation,
$PwdPc, $HHOH, $disability, $OrgCat,
$subDDVal, $subDDIPO_NO, $subDDIPO_Date, $subDDIPO_Amount,$subDDIPO_Branch,
$Lang,$Nation,$subNationOthers,
$subPermanentAddLine1, $subPermanentAddLine2,$subPermanentCity, $subPermanentState,$subPermanentPincode,
$subPresentAddLine1, $subPresentAddLine2,$subPresentCity, $subPresentState,$subPresentPincode,
$subCity, $subDistrict, $subState, $subCommunity ,
$subStation, $TodayDate
){
date_default_timezone_set('Asia/Calcutta');
$DateTime = date('l jS \of F Y h:i:s A');
mysql_query('LOCK TABLES user');
mysql_query('LOCK TABLES usereducation');
$UserId = $Uniq_Id;
$q = "INSERT INTO ".TBL_USER."(UserId,postapply,name,fathername,email,dob,uniq_Id,age_on_year,age_on_month,age_on_day,imgval,
exserviceman,ex_Served,ex_yr,ex_mon,ex_day,ex_Designation,pwdpc,hhoh,pwdpc_disability,org_cat,
dd_ipo,ddipo_NO,ddipo_Date,ddipo_Amount,ddipo_Branch, lang_id,nation_id,nationothers,
station,TodayDate
)
VALUES
('$UserId','$PostApply','$name', '$fathername', '$email','$dob','$Uniq_Id',$age_on_year,$age_on_month,$age_on_day,'$ImgVal',
$Exservice,'$Ex_Served',$Ex_yr,$Ex_mon,$Ex_day,'$Designation',$PwdPc,$HHOH,'$disability',$OrgCat,
'$subDDVal','$subDDIPO_NO','$subDDIPO_Date',$subDDIPO_Amount,'$subDDIPO_Branch',
$Lang,$Nation,'$subNationOthers',
'$subStation', '$TodayDate' )";
$result = mysql_query($q, $this->connection);
$uid = mysql_insert_id();
$p = "INSERT INTO ".TBL_USEREDUCATION."(user_uniqid, board, board_passyr, HigherQ ,
PermanentAddLine1, PermanentAddLine2, PermanentCity, PermanentState, PermanentPincode,
PresentAddLine1, PresentAddLine2, PresentCity, PresentState, PresentPincode,
Time, city, district, state, community
)
VALUES
('$Uniq_Id','$subBoard',$subPassYear, '$subHigherQ' ,
'$subPermanentAddLine1', '$subPermanentAddLine2','$subPermanentCity', '$subPermanentState',$subPermanentPincode,
'$subPresentAddLine1', '$subPresentAddLine2','$subPresentCity', '$subPresentState',$subPresentPincode,
'$DateTime', '$subCity', '$subDistrict', '$subState', '$subCommunity'
)";
$resultP = mysql_query($p, $this->connection);
$UserId = $this->AutoUserId($PostApply,$uid);
$up_id = "UPDATE ".TBL_USER." SET UserId = '$UserId' WHERE Uniq_Id = '$Uniq_Id'";
mysql_query($up_id, $this->connection);
/* Error occurred, return given name by default */
if(!$result){
$Delq = "DELETE FROM ".TBL_USEREDUCATION." WHERE user_uniqid = '$Uniq_Id'";
mysql_query($Delq, $this->connection);
}
if(!$resultP){
$DelP = "DELETE FROM ".TBL_USER." WHERE uniq_Id = '$Uniq_Id'";
mysql_query($DelP, $this->connection);
}
mysql_query('UNLOCK TABLES');
if(!$result || !$resultP){
return NULL;
}
return $result;
}