Username:
Password:

Web - Create a basic blog using php/mysql

Creation: 14/07/2009 15:53

Last Modification: 18/07/2009 18:00

Here is a sum up of how i created my blog.

It is based on 2 sql tables:
- one for the categories with an integer indentifier and a name


CREATE TABLE blog_cat (
  id int(11) NOT NULL auto_increment,
  name char(255) default NULL,
  PRIMARY KEY  (id)
)


- one for the entries with an integer identifier, a title, contents,
  date of last mofication and date of creation, identifier of the
  category corresponding.

CREATE TABLE blog_entry (
  id int(11) NOT NULL auto_increment,
  title text,
  category int(11) default NULL,
  creation datetime default NULL,
  lastmod datetime default NULL,
  content longtext,
  PRIMARY KEY  (id)
)


An article is then created and attached to one category. Once an article
exists only the last mofication time will be shown.

This blog is still missing some features:
- add a list of links to an article
- add some files possible to download
- perhaps make it possible to have a better presentation

Each article is only displayed using a "pre" html category so i don't have
to care about new lines and others.

Don't forget to use addslashes/stripslashes when modifying/reading entries
from the database otherwise you will get problems with special characters.