Question: Assignment 4: PHP and MySQL Programming Part 1: A Guest Book Your tasks is to create a guest book that contains three small php-scripts as
Assignment 4: PHP and MySQL Programming Part 1: A Guest Book Your tasks is to create a guest book that contains three small php-scripts as follows i.connect.php, which will set up a connection to the database. :guestbook.php, which will show all the guestbook entries and allow the user to make a new entry post.php, which will save new entries into your database. The database table To store your guestbook entries you will need to set up a new table in your database. We're only going to be storing nicknames and messages so your SQL table creation statement should be simple enough. You can use this if you would like CREATE TABLE guestbook ( nickname VARCHAR(32), message TEXT The create table statement tells the database that you want your new table to be called guestbook and that it should have two columns (nickname and message). In the nickname column, you want to be able to store strings, and you don't want any nicknames to exceed 32 characters. You can do this by setting the nickname type to VARCHAR (which can hold up to 256 characters) and you limit its size to 32 characters. You want the message column to store text that is longer than 256 characters, so you set the type to TEXT, which can pretty much store, an unlimited number of The Connection For the PHP portion of this system we will start with connect.php. This script will simply establish a connection to your database. Since both your other scripts will require a database connection, we put the connection code ina file of its own, which can be included wherever a connection is needed. Thus, saving you some time. 4?php We create and store our connection link in a variable called $connection by calling mysgl connect which takes host, username
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
