title: INSERT... WHERE NOT EXISTS error
body: <p>I have syntax error with my code</p>
  
  <pre><code>$insert = @mysql_query("INSERT INTO topics (t_title, t_desc, t_pic, t_link, t_date,cat_id)
  SELECT '$t_title','$t_desc','$t_pic','$t_link','$t_date','$cat_id'
  WHERE NOT EXISTS (SELECT t_link
  FROM topics
  WHERE t_link = $t_link
  ) 
  ")or die(mysql_error());
  </code></pre>
  
  <p>This returns an error :</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 'WHERE NOT EXISTS (SELECT t_link FROM topics WHERE t_link = 'showthread.php?t=120' at line 3
  </code></pre>
  
  <p>I thought that the problem is with t_link = $t_link</p>
  
  <p>But when i replaced it with normal value , the problem persists.</p>
  
  <p>Any help ?    </p>