I've got two tables. I want to, when submitting a form, use parentcreate.php as action and with that file insert a couple of variables into the first table and at the same time update the other table with one of the variables. I've searched online but the closest thing I found was inserting and updating a single table, not two different.
Thanks in advance.
Update:
Here's the code I've got so far, as you can see it's just inserting into the first table.
session_name('knine_settings_login');
session_set_cookie_params(1*1*1*15*60);
session_start();
mysql_connect('xxxx', 'xxxx', 'xxxx') or die(mysql_error());
mysql_select_db("xxxx") or die(mysql_error());
$ClassIDOne = mysql_real_escape_string($_POST["cidone"]);
$ClassIDTwo = mysql_real_escape_string($_POST["cidtwo"]);
$ClassIDThree = mysql_real_escape_string($_POST["cidthree"]);
$ClassIDFour = mysql_real_escape_string($_POST["cidfour"]);
$ClassIDFive = mysql_real_escape_string($_POST["cidfive"]);
$usr = $_SESSION["usr"];
mysql_query("SET NAMES 'utf8'") or die(mysql_error());
mysql_query("SET CHARACTER SET 'utf8'") or die(mysql_error());
$query="INSERT INTO knine_parent_db
SET usr = '$usr', ClassIDOne = '$ClassIDOne', ClassIDTwo = '$ClassIDTwo', ClassIDThree = '$ClassIDThree', ClassIDFour = '$ClassIDFour', ClassIDFive = '$ClassIDFive'";
I basically want to execute both these queries at the same time:
$query="INSERT INTO knine_parent_db
SET usr = '$usr', ClassIDOne = '$ClassIDOne', ClassIDTwo = '$ClassIDTwo', ClassIDThree = '$ClassIDThree', ClassIDFour = '$ClassIDFour', ClassIDFive = '$ClassIDFive'";
$query="UPDATE knine_settings_login
SET ClassID = '$usr' WHERE usr ='$usr'";