title: how to insert multiple variables into a sql query
body: <pre><code>&lt;?php
    session_start();
    include('function.php');
  
    site::db();
    $type=$_GET['type'];
    $date=$_GET['date'];
    $amount=$_GET['amount'];
  
    switch($type) {
      case "in_park":
        $table = "lot_income";
        $col = "date,amount";
        $val = $date $type $amount;
        break;
    }
  
    $sql = mysql_query("INSERT INTO $table ($col) VALUES ('$val')");
    if(!$sql) {
      die(mysql_error());
    } 
  
    //header("LOCATION: dashboard.php")
  ?&gt;
  </code></pre>
  
  <p>This will not work but im assuming that i will will need to explode the variables val but how to i put the comma in there too so i can put the info in many different field other than just one field.</p>