title: Prepared statement select inside values() is this right way to do it?
body: <p>Is this right way to right prepared statement when you have to run select stement inside value which is usually values(?)</p>
  <pre><code>   function permission_table($conn, $username) {
      if($stmt = $conn-&gt;prepare(&quot;INSERT INTO perm (user_id) VALUES(SELECT id FROM users WHERE username = ?)&quot;)) {
              $stmt-&gt;bind_param(&quot;s&quot;, $username);
              $stmt-&gt;execute();
  }
  }
  </code></pre>