SQL'izing the Guestbook Example
My Guestbook
Welcome to my Guestbook
Please write me a little note below
mysql_connect("localhost");
if(isset($note)) {
$ts = date("Y-m-d H:i:s");
mysql_db_query("mydb","insert into comments values (0,\'$note\',\'$ts\')");
}
?>
The entries so far:
$result = mysql_db_query("mydb","select * from comments");
while($row=mysql_fetch_row($result)) {
echo $row[0] ." " . $row[1] . " " . $row[2] . "
\n";
} ?>