I feel dumb asking this question. I'm having a heck of a time trying to get a simple one text field in an html form to pass over to the MySql database via PHP. The id and date_time field are getting inserted but the text from the form text field isn't.
Here is what I got.
FORM.HTML:
<form action="php/comments.php" method="post" />
<input type="text" id="comment" />
<input type="submit" class="submit" value=" Submit Comment " />
</form>
COMMENTS.PHP:
<?php
mysqli_query($db_conx, "INSERT INTO comments(comment, date_time)
VALUES('$comment',now())");
header ("location: form.html");
?>
COMMENTS TABLE (rows):
id
comment
date_time
Like I said the "id" which is set up as AUTO_INCREMENT and "date_time" rows are getting inserted. Comment, however, is coming up blank even though something was typed into the form.
Any help/ideas would be greatly appreciated. Can't quite figure out what I'm missing.