Hello all, again. 😛
I have another problem, this time with a mysql count.
I am trying to count the number of rows in a comments table which bears the same news_id.
My MySQL query is this:
$query = "SELECT COUNT(com_id) FROM comments_data WHERE news_id = '$news_id'";
$total_comments = mysql_result($query);
if ($total_comments = 0) { echo "There are currently no comments for this news post"; }
But I get this error... Warning: Supplied argument is not a valid MySQL result resource in /usr/local/psa/home/vhosts/devjunkie.co.uk/web_users/djclan/DJ2/site.php on line 203
On line 203 is the $total_comments = mysql_result($que.... Line
If anyone could help i'd much appreciate it, thank you 🙂