hey basically on my site ive got users posting blogs, and users commenting on those blogs, now what i am trying to do is show how many comments there is for each blog... below is the code for inserting the comment and also adding +1 to the number of comments.... everything in the code works fine, at first it adds 1 to the 0 which is set when a blog is posted but once a second comment is posted it stays at 1 ... any ideas
<?php
$con = mysql_connect("CONNECT HERE");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("dbname", $con);
$username=$SESSION['username'];
$plus='++';
$sql="INSERT INTO blog_comments (blog_comment_id, blog_id, comment, username, date, time)
VALUES
('$POST[blog_comment_id]','$GET[blogid]','$POST[comment]','$username', NOW(), CURTIME())";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$sql1="UPDATE blogs SET comment_no='++' WHERE blog_id='$_GET[blogid]' ";
if (!mysql_query($sql1,$con))
{
die('Error: ' . mysql_error());
}
header("location:blog_comments.php?blogid=$_GET[blogid]");
mysql_close($con)
?>