title: I want to insert two values into a same table of sql, the first value is from another table and other value is argv[2]?
body: <p>I want to insert two values into the same table of SQL. The first value comes from another table and the other value is argv[2].</p>
  
  <p>This is the code that I am using but it does not work. </p>
  
  <pre><code> for($i=0;$i&lt;=feof($getdata);$i++){
      if (filter_var($data[$i][1], FILTER_VALIDATE_EMAIL)){
          //echo $data[$i][1];
          $email=$data[$i][1];
          $type=$argv[2];
          $name=$data[$i][0];
          $sql ="INSERT INTO promo_user (name,email) VALUES ('$name','$email')";
          mysqli_query($conn,$sql);
          $uid = mysqli_insert_id($conn);
          $sql ="INSERT INTO promo_type set uid =$uid";
          mysqli_query($conn,$sql);
          $sql = "INSERT INTO promo_type (type) values ('$type')";
          mysqli_query($conn,$sql);
          }
      }
      mysqli_close($conn);
  </code></pre>