Is it possible to edit and save data as coded below simultaneously to two different tables? Just look at the code which enters data to the data tables.
if($opt>=$rec['gwstart'] && $opt<=$rec['gwend'])
{
$con=mysql_connect('localhost','root') or die ("Server connection failure!");
$db=mysql_select_db('regional_data',$con) or die ("Couldn't connect the database");
$SQL22="UPDATE newchk SET totgw=$AAA where gwstart=$BBB";
$run22=mysql_query($SQL22,$con) or die ("SQL Error");
$SQL33="INSERT INTO invoentry (user_inv,dist_inv,chkNum,InvoNum,InvoVal,InvoDate,DueDate,type,condition) VALUES ('$naMex','$distUsr','$listVal','$InNo','$InValu','$date1','$date2','$typ','$cnd')";
$run33 = mysql_query($SQL33,$con) or die ("SQL Error!..");
$MSG ="Successfully saved your entry! ".$AAA." cheques are remaining.";
}
Yes you can, if your queries are somehow related and you need to make sure they both succeed you can use SQL TRANSACTIONS. otherwise, as you already did, you can run multiple queries.