title: how to write the query command in mysql
body: <p>table <code>categories</code>（TABLE_CATEGORIES） ,which have fields:  <code>categories_id</code> ,<code>parent_id</code> </p>
  
  <p>table <code>categories_description</code>（TABLE_CATEGORIES_DESCRIPTION） which have fields: <code>categories_id</code>, <code>categories_name</code>, </p>
  
  <p>now, according to <code>$cpath=parent_id</code> I want to get the <code>categories_name</code> and <code>categories_id</code> , this is my command,but it shows a grammar error.</p>
  
  <pre><code>$query = "select c.categories_id, cd.categories_name from " .
  TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                            where c.categories_id=cd.categories_id and c.parent_id=".$cPath;
  </code></pre>
  
  <p>the error:1064 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 2</p>