I assume you have some basic knowledge about MySQL, PHP and using MySQL with PHP. Do you already have a database table defined?
Anyway, for the comments, assuming they can be written anonymously, I would create a table comment as such:
`id` INT AUTO_INCREMENT,
`image_id` INT NOT NULL,
`content` VARCHAR(1024) NOT NULL,
`timestamp` TIMESTAMP NOT NULL DEFAULT NOW(),
PRIMARY KEY (`id`)
Create a simple form that will send you to a php page which inserts the entered data into the database.
<form name="comment" action="addcomment.php" method="post">
<input type="hidden" id="image_id" value="$image_id" />
<textarea id="content"></textarea>
<input type="submit" />
</form>
The $image_id should be replaced in your php script by the ID of the image that is being commented on.
The database entry in addcomment.php should contain something similar to this:
<?php
$image_id = $_POST['image_id'];
$content = $_POST['content'];
mysql_query('INSERT INTO `comment` (`image_id`, `content`) VALUES('.$image_id.', "'.$content.'");
?>
Note: those are only bare bone hints that will both look bad and be insecure, but they should help you getting started with this...