title: MySQLi insert statement to executing
body: <p>I am writing a simple code in PHP to test my MySql server by , inserting data to my database server</p>
  
  <p>i am executing the file from the internet</p>
  
  <p>URL of executing : <code>Scores2.php?n=asdad&amp;l=345&amp;s=241</code></p>
  
  <p>PHP Code:</p>
  
  <pre><code>&lt;?php
  $servername = "sql3.freesqldatabase.com";
  $username = "MY USERNAME";
  $password = "MY PASSWORD";
  $dbname = "MY DBNAME";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  } 
  
  
  $name = (string)$_GET['n'];
  $score = (int)$_GET['s'];
  $level = (int)$_GET['l'];
  
  $sql = "INSERT INTO HighScores (name, score, level)
  VALUES ($name, $score, $level)";
  
  if ($conn-&gt;query($sql) === TRUE) {
      echo "New record created successfully";
  } else {
      echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
  }
  
  $conn-&gt;close();
  ?&gt;
  </code></pre>
  
  <p>When i execute the file , the browser shows this error  : </p>
  
  <pre><code>Error: INSERT INTO HighScores (name, score, level) VALUES (asdad, 241, 345)
  Unknown column 'asdad' in 'field list'
  </code></pre>
  
  <p>I checked the <strong>Control Panel</strong> in <strong>phpMyAdmin</strong> and executed the same statement but without variables , and it worked </p>
  
  <p><strong>Rows Types :</strong></p>
  
  <p>name : text</p>
  
  <p>score : int(11)</p>
  
  <p>level : int (11)</p>