title: PHP - Insert variable data to implode
body: <p>This might be very basic for some of you but I really couldn't seem to figure it out @.@</p>
  
  <p>I want to insert <code>$x</code> to this line: <code>(".implode(",",array_keys($data)).")</code>
  and <code>$rid</code> to <code>$values = implode("','", array_values($data));</code></p>
  
  <p>Code:</p>
  
  <pre><code>if(count($data)){
      $x = "rid";
      $rid=$_SESSION['rid'];
      $values = implode("','", array_values($data));
      mysql_query("insert into appetizer (".implode(",",array_keys($data)).") values ('".$values."')");
  
      if(mysql_insert_id()) return mysql_insert_id();
      return 0;
  }
  </code></pre>
  
  <p>How can I possibly do this?</p>
  
  <p>Apologies to the noob question :3</p>