title: PHP SQL Update error
body: <p>I am having a wierd problem when attempting to update a table in my mysql server.</p>
  
  <p>The code:</p>
  
  <pre><code>    $name = trim(FilterText($_POST['name']));
  $description = trim(FilterText($_POST['description']));
  $type = $_POST['type'];
  
  if($groupdata['type'] == "3" &amp;&amp; $_POST['type'] != "3"){ echo "You may not change the group type if it is set to 3."; exit; } // you can't change the group type once you set it to 4, fool
  if($type &lt; 0 || $type &gt; 3){ echo "Invalid group type."; exit; } // this naughty user doesn't even deserve an settings update
  
  if(strlen(HoloText($name)) &gt; 25){
      echo "Name too long\n\n&lt;p&gt;\n&lt;a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"&gt;&lt;b&gt;Done&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;/a&gt;\n&lt;/p&gt;\n\n&lt;div class=\"clear\"&gt;&lt;/div&gt;";
  } elseif(strlen(HoloText($description)) &gt; 200){
      echo "Description too long\n\n&lt;p&gt;\n&lt;a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"&gt;&lt;b&gt;Done&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;/a&gt;\n&lt;/p&gt;\n\n&lt;div class=\"clear\"&gt;&lt;/div&gt;";
  } elseif(strlen(HoloText($name)) &lt; 1){
      echo "Please give a name\n\n&lt;p&gt;\n&lt;a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"&gt;&lt;b&gt;Done&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;/a&gt;\n&lt;/p&gt;\n\n&lt;div class=\"clear\"&gt;&lt;/div&gt;";  
  } else {
      mysql_query("UPDATE groups SET name = '".$name."', type = $type, desc='".$description."' WHERE id = $groupid AND ownerid = '".USER_ID."' LIMIT 1") or die(mysql_error());
      echo "Editing group settings successful\n\n&lt;p&gt;\n&lt;a href=\"".WWW."/groups/".$groupid."/id\" class=\"new-button\"&gt;&lt;b&gt;Done&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;/a&gt;\n&lt;/p&gt;\n\n&lt;div class=\"clear\"&gt;&lt;/div&gt;";
  }
  </code></pre>
  
  <p>At the mysql_query to update groups, I keep getting an error saying that I have an error in my SQL syntax at the part when inserting desc=blahblahbla.</p>
  
  <p>When I take the "desc" part out of the query, and only insert the name and type, the query works perfectly, but when I add the desc back into the query, it throws the error again. There are no '' in the desc part - which could stuff it up, and even if there were, I have filtered them at the start of the code.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>I am using a CMS in case you were wondering</p>
  
  <p>Thanks in advance! :)</p>