title: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
body: <p>I made code to try a users activity on my forum, and when I add in this line</p>
  
  <pre><code>$cat_id = $db-&gt;fetch("SELECT name FROM " . $prefix . "_categories WHERE id =" . mysql_real_escape_string($forum_data['cat_id']));
  $page_title_pro = ' &gt; ' . $system-&gt;present($cat_id['name']) . ' &gt; ' . $system-&gt;present($forum_data['name']) . '';
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>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 's Treasures &gt; Contests' WHERE id = '2'' at line 1
  </code></pre>
  
  <p>I am assuming that the 2 is my user id, and in the footer, I have this :</p>
  
  <pre><code>$db-&gt;query("UPDATE accounts SET flocation = '$session_location', page = '$page_title_pro'  WHERE id = '$id';");
  </code></pre>
  
  <p>I can't seem to find the error, and every goes back to normal when i take the cat_id out, but then i can't use the current activity for the profiles. Any suggestions? </p>