View Single Post
  #8 (permalink)  
Old 05-03-2007, 02:11 AM
melkior_inactive
Guest
 
Posts: n/a
iTrader: / %
Default Lesson 2 - The Database

Before writing any code we need to design the database cause we really need to know what data we'll be using in the script and also what functions we'll need to create.

We'll start with a simple database - it will use only one table. We don't need too much at first anyway.
We'll need a date on the posts, their titles, the text in the post and we'll add an ID for the posts (we'll need that later).
So here's the SQL code for creating the table. You can run this query in phpmyadmin after creating the database or import it or whatever suits you.
Code:
CREATE TABLE `blog` (
`id` INT( 128 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`date` TIMESTAMP NOT NULL ,
`title` VARCHAR( 100 ) NOT NULL ,
`text` TEXT NOT NULL
);
So now we have a table named blog ready for our inputs.
We'll be expanding this database in future tutorials.
Reply With Quote