MANAGING CONTENT The final (Web design software) two columns hold the
MANAGING CONTENT The final two columns hold the date and time when the article was last updated, and when it was originally created. Although it may seem illogical to put the updated column first, this is to take advantage of the way MySQL automatically updates the first TIMESTAMP column in a table. The created column gets its value from a MySQL function called NOW(), neatly sidestepping the problem of preparing the date in the correct format for MySQL. The thorny issue of dates will be tackled in the next chapter. Creating the journal database table If you just want to get on with studying the content management pages, use journal.sql in the download files for this chapter. Open phpMyAdmin, select the phpsolutions database, and import the table in the same way as in the previous chapter. The SQL file creates the table and populates it with four short articles. Use journal40.sql for MySQL 4.0 or journal323.sql for MySQL 3.23. If you would prefer to create everything yourself from scratch, open phpMyAdmin, select the phpsolutions database, and create a new table called journal with five fields (columns). Use the settings shown in the following screenshot and Table 13-1. Table 13-1. Column definitions for the journal table Field Type Length/Values Attributes Null Default Extra Primary key article_id title article INT VARCHAR TEXT 255 UNSIGNED not null not null not null auto_ increment Selected 13 updated TIMESTAMP ON UPDATE CURRENT_ TIMESTAMP not null CURRENT_ TIMESTAMP created TIMESTAMP not null 349
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.