title: Error INSERT INTO MySQL Table
body: <p>Learning PHP with MYSQL from w3schools. Everything is going fine but when i am trying to enter multiple value into table and it shows below error.</p>
  
  <pre><code>Error INSERT INTO MyGuests (firstname, lastname, email) VALUES ('John', 'Doe', 'john@example.com')INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Mary', 'Moe', 'mary@example.com')INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Julie', 'Dooley', 'julie@example.com')
  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO MyGuests (firstname, lastname, email) VALUES ('Mary', 'Moe', 'm' at line 2
  </code></pre>
  
  <p>Here is my code Sample </p>
  
  <p>
  
  <pre><code>$server = 'localhost';
  $username = 'root';
  $password = '';
  $database = 'envy';
  
  // Create Connection
  $conn = new mysqli($server, $username, $password, $database);
  
  if($conn-&gt;connect_error){
      die("Connected Successfully.".$conn-&gt;connect_error);
  }
  
  $sql = "INSERT INTO MyGuests (firstname, lastname, email)
  VALUES ('John', 'Doe', 'john@example.com')";
  
  $sql .= "INSERT INTO MyGuests (firstname, lastname, email)
  VALUES ('Mary', 'Moe', 'mary@example.com')";
  
  $sql .= "INSERT INTO MyGuests (firstname, lastname, email)
  VALUES ('Julie', 'Dooley', 'julie@example.com')";
  
  if($conn-&gt;query($sql)==TRUE){
      $lastid = $conn-&gt;insert_id;
      echo "New Record Created successfully. Last id: ". $lastid;
  }else{
      die("Error ".$sql."&lt;br&gt;".$conn-&gt;error);
  }
  
  $conn-&gt;close();
  </code></pre>
  
  <p>As a beginner i don't where is the problem. I wrote the exact code like the tutorial but </p>
  
  <p>Here is a link to the tutorial. <a href="http://www.w3schools.com/php/php_mysql_prepared_statements.asp" rel="nofollow">http://www.w3schools.com/php/php_mysql_prepared_statements.asp</a></p>