MySQL Database Php

in your site usong inline frames with Mysql as a backend. Here goes :)
This is the strcture. Yourew gonna have to create 2 files and edit the file in which you want your shout box.
SQL:
CREATE TABLE `comtbl` (
`postID` INT NOT NULL AUTO_INCREMENT ,
`postTITLE` TEXT NOT NULL ,
`posterNAME` TEXT NOT NULL ,
`posterEMAIL` TEXT NOT NULL ,
`postTIME` TIMESTAMP NOT NULL ,
`postTXT` TEXT NOT NULL ,
PRIMARY KEY ( `postID` )
);
comment.php
//Edit only the line below
$dbcnx = mysql_connect("localhost", "username", "password");
mysql_select_db("comments");
$result = @mysql_query("SELECT * FROM comtbl ORDER BY postID DESC");
if (!$result) {
echo("Error performing query: " . mysql_error() . "");
exit();
}
while ($row = mysql_fetch_array($result) ) {
$msgTxt = $row["postTXT"];
$msgId = $row["postID"];
$SigName = $row["posterNAME"];
$SigDate = $row["postTIME"];
$msgTitle = $row["postTITLE"];
$url = $row["posterEMAIL"];
$yr = substr($SigDate, 2, 2);
$mo = substr($SigDate, 4, 2);
$da = substr($SigDate, 6, 2);
$hr = substr($SigDate, 8, 2);
$min = substr($SigDate, 10, 2);
if ($hr > "11") {
$x = "12";
$timetype = "PM";
$hr = $hr - 12;
}else{
$timetype = "AM";
}
if (!$url) {
$url = "#";
}else{
$stat = $url;
$url = "mailto:" . $url . "";
}
echo("

$msgTitle $msgTxt


$hr:$min $timetype | $mo/$da/$yr | $msgId, $SigName

");
}
?>
commentadd.php
$assume = $_POST['assume'];
$posterEMAIL = $_POST['postemail'];
$postTXT = $_POST['posttxt'];
$posterNAME = $_POST['poster'];
$postTITLE = $_POST['posttitle'];
if ($assume == "true") {
$dbcnx = mysql_connect("localhost", "username", "password");
mysql_select_db("comments");
$sql = "INSERT INTO comtbl SET posterNAME='$posterNAME', posterEMAIL='$posterEMAIL',
postTXT='$postTXT', postTITLE='$postTITLE'";
if (mysql_query($sql)) {
echo("Your comment has been added");
} else {
echo("Error adding entry: " . mysql_error() . "");
}
}
?>
Now in the file where you want this shout box to be displayed, use the following script where you want the box to appear












Best of luck with your new shout box ;)