I've 2 tables which are article table and comments table, the 2 tables have d same id, the problem is i've to get the number of comments in a particular article. but my codes is not functioning....
f u've tym guyz check my code below..
$num=0;
$result ="";
$res_comment=$connector->query("SELECT * FROM article, comments WHERE comments.id = article.article_id ");
$resultquery=mysql_query($res_comment);
$num =mysql_num_rows($resultquery);
if($num==0)
{
$result = "Leave Comment";
}
else
{
$result =$num;
while($variable=mysql_fetch_assoc($resulquery))
{
extract($variable);
}
}