Comments not Getting Inserted into MySQL Table

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-04-02T01:32:02Z Indexed on 2010/04/02 1:33 UTC
Read the original article Hit count: 449

Filed under:
|

Hello,

I'm trying to use the code below for a comment system. It doesn't work. The info I'm trying to insert into the MySQL table "comment" isn't getting put there. Any idea(s) why it is not working?

Thanks in advance,

John

On comments.php:

echo '<form action="http://www...com/sandbox/comments/comments2.php" method="post"> 
    <input type="hidden" value="'.$_SESSION['loginid'].'" name="uid">
    <input type="hidden" value="'.$submissionid.'" name="submissionid">  

    <label class="addacomment" for="title">Add a comment:</label>
    <input class="commentsubfield" name="comment" type="title" id="comment" maxlength="1000">  

    <div class="commentsubbutton"><input name="submit" type="submit" value="Submit"></div> 
</form>
';

On comments2.php:

$comment = $_POST['comment'];
$uid = $_POST['uid'];
$subid = $_POST['submissionid'];


mysql_query("INSERT INTO comment VALUES (NULL, '$uid', '$subid', '$comment', NULL, NULL)");

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql