title: I want to use the INSERT statement to insert values that come from the SELECT statements in PHP
body: <p>I want to use the INSERT statement to insert values that come from the SELECT statements in PHP</p>
  <p>the table of student is not get the data</p>
  <pre><code>$sql = &quot;INSERT INTO student(academic_major, promo, user_id) VALUES (?, ?, (?));&quot;;
  $stmtt = mysqli_stmt_init($conn);
  if(!mysqli_stmt_prepare($stmtt, $sql)){
      header(&quot;Location: add_student_forum.php?error=sqlerrorstudent&quot;);
      exit();
  }else{
  
      $id = &quot;SELECT id FROM user WHERE email = '$email'&quot;;
      mysqli_stmt_bind_param($stmtt, &quot;sss&quot;, $academic_major, $promo, $id);
      mysqli_stmt_execute($stmtt);
      header(&quot;Location: add_student_forum.php?signup=success&quot;.$id);
      exit();
  }
  </code></pre>
  <p>when i execute it shows me this header header(&quot;Location: add_student_forum.php?signup=success&quot;.$id); in the url
  and i dont know why the table is empty after</p>