title: Importing excel file into mysql with php
body: <p>I am trying to insert excel file into database my code is : </p>
  
  <pre><code>&lt;?php
  
  require_once 'Excel/reader.php';
  $data = new Spreadsheet_Excel_Reader();
  $data-&gt;setOutputEncoding('CP1251');
  $data-&gt;read('Excel/exceltestsheet.xls');
  
  $conn = mysql_connect("localhost","root","");
  mysql_select_db("dbname",$conn);
  
  for ($x == 2; $x &lt;== count($data-&gt;sheets[0]["cells"]); $x++) 
  {
  $name = $data-&gt;sheets[0]["cells"][$x][1];
  $extension = $data-&gt;sheets[0]["cells"][$x][2];
  $email = $data-&gt;sheets[0]["cells"][$x][3];
  $sql = "INSERT INTO msg (name,extension,email) 
      VALUES ('$name',$extension,'$email')";
  echo $sql."\n";
  mysql_query($sql);
  } 
  ?&gt;
  </code></pre>
  
  <p>When I insert then I am getting an error which is 
  <code>Parse error: syntax error, unexpected '=' in C:\wamp\www\uploadexcel.php on line 11</code></p>