Hey everybody...
i have this problem:
i have my comment system working in terms of adding and displaying the data... but there's this thing that everytime the page loads insert a new blank field in the database... here's the code... thank in advance
<form action="<?=$PHP_SELF?>" method="post">
Nombre:<br />
<input type="text" name="name" id="name" />
<br />
Commentario:<br />
<input type="text" name="comment" id="comment" />
<br />
<input type="submit" value="Enviar" /></form>
<?php
mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("gallery") or die(mysql_error());
$id = $_GET['id'];
$result2 = mysql_query("SELECT * FROM images_comments WHERE image_id = '$id' ORDER BY ID DESC");
$sql="INSERT INTO images_comments (id, image_id, name, comment)
VALUES ('','$id','$_POST[name]','$_POST[comment]')";
!mysql_query($sql);
?>