I have two SQL queries:
$res1 = mysql_query("SELECT * FROM `table1` WHERE `user`='user'");
$i = mysql_fetch_assoc($res1);
$value1 = $i['num'];
And:
$res2 = mysql_query("INSERT INTO `table2` (`name`,`num`) VALUE ('name','$value1')");
How to combine the two SQL queries into one? I need to get the value of the variable from of a second query for the first request. Is it possible?