Hello guys I am trying to apply this query but values are not saving in my database. I have tried a lot but I am not able to fix it. Please Help me. Thanks in advance
if($_POST) {
$lecturer_id = $_SESSION["lecturer_id"];
$game_name= $_POST['game_name'];
mysql_query("insert into games(game_name, lecturer_id) values ('$game_name', '$lecturer_id')");
$input_type = $_POST['type'];
if($input_type=='multiple_choice') {
$question= $_POST['quest'];
$val1= $_POST['value1'];
$val2= $_POST['value2'];
$val3= $_POST['value3'];
$val4= $_POST['value4'];
//echo $question;
// echo $val4;
mysql_query("insert into subgames(game_id, input_id, statement, option1, option2, option3, option4) values ((SELECT id
FROM games
WHERE game_name = '$game_name'), '$input_type', '$question', '$val1', '$val2', '$val3', '$val4'");
} elseif($input_type=='input_field') {
$question= $_POST['quest'];
$answer= $_POST['ans'];
}
} else {
echo "Not Submitted";
}