How to get the CID number of comments from comment table? If you check the comment table, you can see taht each comment has a CID number. 
For each article I need to have the CID number of all the comments for that article.

So I have written the following in node.tpl.php file:

 $result=db_select('comment', 'c')
 -&gt;fields('cid')
  -&gt;condition('nid', $node-&gt;nid,'=');

  $record=$result-&gt;execute()-&gt;fetch();


But I get error. So what is my mistake?
$result=db_query('SELECT cid FROM comment WHERE nid = :nid',array(':nid' =&gt; $node-&gt;nid));


Hope this helps you.