Hey
<?php
$comment = filter_input(INPUT_GET, 'comment');
if (!empty($comment)){
$host = "";
$dbusername = "";
$dbpassword = "";
$dbname = "";
// Create connection
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_errno() .') '
. mysqli_connect_error());
}
else{
$sql = "INSERT INTO comment(comment)
values ('$comment')";
if ($conn->query($sql)){
echo "New record is inserted sucessfully";
}
else{
echo "Error: ". $sql ."
". $conn->error;
}
$conn->close();
}
}
else{
echo "Comment should not be empty";
die();
}
?>
<?php
$result = mysqli_query("SELECT comment FROM comment");
?>
<p><?php echo $GET["comment"]; ?></p>
</div>
</div>
The data submitted from the attached form is stored within my DB. Issue is retrieving that data (echo) so it can display. Where in this code do I change it so the echo works properly?
Thank ya