You will also need to run the following MySQL query either in the console or using phpMyAdmin:
CREATE TABLE `shoutbox` (
`id` integer(255) NOT NULL auto_increment,
`user` integer(255) NOT NULL,
`date` integer(255) NOT NULL,
`content` varchar(100) NOT NULL,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
Now the above files assume that you have already written to your session the following variables,
$_SESSION['id'] : This is the current users unique id number
£_SESSION['username'] : The current users display name
These variables would usually be set in some kind of user login script however to test the shoutbox you could just write them in to the shoutbox.php script.
Just to recap quickly, in shoutbox.php where there is the following line:
mysql_connect ('MYSQL HOST', 'MYSQL USERNAME', 'MYSQL PASSWORD'); mysql_select_db ('DATABASE NAME');Replace MYSQL HOST with your hostname eg. localhost, MYSQLUSERNAME with your username eg. root, and MYSQL...well you get the idea. Also do the same for the very last line of code in shoutbox.php. Also replace the two $_SESSION variables outlined above with what ever your site uses.