Hum, I don't have time for a complete code for you, but here's something I use on my website to add blog-like articles. I did a bit of editing to make it easier for you to use and to fit a bit more with what you're looking for, I hope you'll be able to work from that.
Code:
<?php
//Form already sent?
if (isset($_POST['add']))
{
//If so, connect to database
$connection = mysql_connect("host","user","password");
if ( ! $connection )
die ("connection failed");
$link="database_name";
mysql_select_db($link) or die ("no connection");
// Create variables
$name = $_POST['name'];
$title = $_POST['title'];
$comment = $_POST['comment'];
//Check if all the info is there and send it
if (isset($name) AND $name !="" && isset($title) AND $title !="" && isset($comment) AND $comment !="")
{
mysql_query("INSERT INTO table_name (name, title, comment)
VALUES ('$name', '$title', '$comment')");
}
//Close connection
mysql_close($connection);
// Here you can echo a confirmation message, redirect somewhere or whatever
}
else {
//If the form has not been sent, show it to the user
//Connecting to database
$connection = mysql_connect("host","user","password");
if ( ! $connection )
die ("connection failed");
$link="database_name";
mysql_select_db($link) or die ("no connection");
echo "
<FORM method=post action=\"page.php\">
<table>
<tr>
<td>
Name :
</td>
<td>
<INPUT type=text name=\"name\">
</td>
</tr>
<tr>
<td>
Title :
</td>
<td>
<INPUT type=text name=\"title\">
</td>
</tr>
<tr>
<td>
Comment :
</td>
<td>
<TEXTAREA cols=50 rows=15 name=\"comment\"></TEXTAREA>
</td>
</tr>
<tr>
<td>
<INPUT type=\"submit\" name=\"add\" value=\"Send\">
</td>
</tr>
</table>
</FORM>
";
}
In your case, you would have to keep in mind that it's for a blog. Which means, you could/should add entries in your database to indicate to which blog entry this comment belongs.
For example, you could have a "blog" table with the entries "id", "date", "title", "text" and a "comments" table with the entries "id", "name", "title", "comment", "blog" and, if you want, a "date" as well but you'd have to use a timestamp or something to get it, which I don't know much about.
The "blog" entry would be the one where you say to which blog it refers, either using the blog's ID, name or else. And getting that information depends pretty much on how you display your blog...