Your next step is to Insert some rows in your newly created table, this is one of the easiest things to do. Be sure to validate input from forms before you insert it however, because otherwise you will be wide open to injection attacks and the like.
I will cover the Markup and Style of the Guestbook in a later Article.
Inserting Posts in the Table
The below Example shows how to Insert Data in your MySQL table.
INSERT INTO GuestBook_Posts (Text, Time) VALUES ( 'This is some Example Text', '1241015253' );
The below shows how to do it in PHP.
<?php $TimeStamp = time(); mysql_query("INSERT INTO GuestBook_Posts (Text, Time) VALUES ( 'This is some Example Text', '$TimeStamp')", $Connection) or die(mysql_error()); ?>
You can use the PHP time to get te current time, like done in above Example.
This time i recommend that you read the Explanation.
How the Insert Works.
INSERT INTO GuestBook_Posts (Text, Time)
The above part tells MySQL where to insert the Data, in this case we will be inserting in the GuestBook_Posts Table, and the Text and Time columns.
VALUES ( 'This is some Example Text', '1241015253')", $Connection)
The above is what to be Inserted, and the connection to be used. Note that they are ordered in the same way as we defined where to insert the data (Text, Time)
The wrong way of doing this would be like below.
VALUES ( '1241015253', 'This is some Example Text')", $Connection)
The last part just outputs an error, (if any).
Is the PostID Missing?
PostID is only missing from our query because its the Auto Increment column, MySQL will fill it out on its own, so we do not need to worry about finding a Unique ID.