title: The 'group' column somehow causes a syntax error
body: <p>I keep getting this error:</p>
  
  <blockquote>
    <p>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 '...' at line 1.</p>
  </blockquote>
  
  <p>I know that it is something wrong with my "group" field, because if I delete it my table gets updated without any problems.</p>
  
  <p>Here is my form code:</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" action="products_import_confirmation.php" method="post"&gt;
  &lt;input type="hidden" name="MAX_FILE_SIZE" value="99999999" /&gt;
  &lt;center&gt;&lt;table&gt;&lt;br&gt;&lt;br&gt;
  &lt;td&gt;Prekės pavadinimas:     
  &lt;td&gt;&lt;input type="text" name="name_p" value="&lt;?php echo $name_p;?&gt;"&gt;
  &lt;span class="error"&gt;* &lt;?php echo $name_pErr;?&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;td&gt;Gamintojas:&lt;td&gt;&lt;input type="text" name="brand" value="&lt;?php echo $brand;?&gt;"&gt;
  &lt;span class="error"&gt;* &lt;?php echo $brandErr;?&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;td&gt;Specifikacijos:&lt;td&gt;&lt;textarea style="resize:none" name="specs" rows="5" cols="60"&gt;&lt;?php echo $specs;?&gt;&lt;/textarea&gt;
  &lt;span class="error"&gt;* &lt;?php echo $specsErr;?&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;td&gt;Aprašymas:&lt;td&gt;&lt;textarea style="resize:none" name="about" rows="5" cols="60"&gt;&lt;?php echo $about;?&gt;&lt;/textarea&gt;
  &lt;tr&gt;
  &lt;td&gt;Kategorija:&lt;td&gt;&lt;select name="group" value="&lt;?php echo $group;?&gt;"&gt;
  &lt;option value=""&gt;Pasirinkite kategoriją&lt;/option&gt;
  &lt;option disabled&gt;------------------&lt;/option&gt;
  &lt;option value="Telefonai"&gt;Telefonai&lt;/option&gt;
  &lt;option value="Planšetės"&gt;Planšetės&lt;/option&gt;
  &lt;option value="Kompiuteriai"&gt;Kompiuteriai&lt;/option&gt;
  &lt;/select&gt;
  &lt;span class="error"&gt;* &lt;?php echo $groupErr;?&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;td&gt;&lt;div&gt;&lt;input name="image" accept="image/jpeg" type="file" /&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;tr&gt;
  &lt;/center&gt;&lt;/table&gt;                               
  &lt;td&gt;&lt;div&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And here is my update to MySQL code:</p>
  
  <pre><code>&lt;?php
  require("/includes/connection_to_db.php");
  
  mysql_query("SET NAMES 'utf8'"); 
  
  session_start();
  echo "&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/&gt;";
  
  if(isset($_GET['logout']) &amp;&amp; $_GET['logout'] == "true"){
  unset($_SESSION['user_id']);
  header("Location: index.php");
  }
  if (isset($_FILES['image']) &amp;&amp; $_FILES['image']['size'] &gt; 0) 
      {
          // Temporary file name_p stored on the server
          $tmpname_p = $_FILES['image']['tmp_name'];
  
          // Read the file
          $fp = fopen($tmpname_p, 'r');
          $image = fread($fp, filesize($tmpname_p));
          $image = addslashes($image);
          fclose($fp);
  
          date_default_timezone_set('Europe/Vilnius');
          $V_ID = mysql_real_escape_string($_SESSION['user_id']);
          $name_p = mysql_real_escape_string($_POST['name_p']);
          $group = mysql_real_escape_string($_POST['group']);
          $brand = mysql_real_escape_string($_POST['brand']);
          $specs = mysql_real_escape_string($_POST['specs']);
          $about = mysql_real_escape_string($_POST['about']);
          $date = date('Y-m-d H:i:s'); 
  
          $query = "INSERT INTO prekės (V_ID, name, group, brand, specs, about, image, date)
                  VALUES ($V_ID, '$name_p', $group, '$brand', '$specs', '$about', '$image', '$date')";
  
          if(mysql_query($query))
          {
  
              echo "Prekė ".$name." sėkmingai įkelta &lt;br&gt;";
              echo "&lt;a href=\"../main.php\"&gt;Grįžti&lt;/a&gt;";
          }
          else
          {
  
              echo "Įvyko klaida: ".mysql_error()."&lt;br&gt;";
              echo "&lt;a href=\"../products_import.php\"&gt;Grįžti&lt;/a&gt;";
              echo $date;
              echo $name_p;
              echo $brand;
              echo $specs;
              echo $about;
              echo $group;
          }
      }
      else 
      {
          echo "Neužpildyti visi reikalaujami duomenys.";
      }
  
  mysql_close();
  ?&gt;
  </code></pre>
  
  <p>As you see I made some echo's to check if I get my data and there is everything okay. It's only something bad going with "group" data. Any ideas?</p>