Hey, im sorry if I have posted this in the wrong section but im new to both php and sql infact this was a tutorial that i copied word for word but to no avail.. It is a guestbook and from what I can gather the sql side of things is working ‘If I enter the data into sql it will display the results’ but the php will not post the variables to sql.
<html>
<head>
<title>THE GUESTBOOK</title>
</head>
<body>
<h1>Welcome to my Guestbook</h1>
<h2>Please write me a note below</h2>
<form action=”<?= “$PHP_SELF#results”?>” method=”POST”>
<textarea cols=40 rows=5 name=note wrap=virtual></textarea>
<input type=”submit” value=” send it “>
</form>
<?php
$conn = mysql_connect(‘localhost’, ‘root’, ‘password’);
mysql_select_db(‘mydb’);
if(isset($note)) {
$ts = date(“Y-m-d H:i:s”);
mysql_query(“INSERT INTO comments values (‘0’, ‘$note’, ‘$ts’)”);
}
?>
<h2>The entries so far:</h2>
<?php
$result = mysql_query(“SELECT * FROM comments”);
while ($row=mysql_fetch_row($result)) {
echo $row[0] . ” ” . $row[1] . ” ” . $row[2] . “<br> n”;
} ?>
</body>
</html>