Hi
I am creating a basic database driven site in PHP/MySQL.
It is simply an article posting site (for example, reviews) which contain text and graphics.
I have come up with the following table design (3rd Normal Form):
ARTICLES(articleID, relAuthorID, relTopicID, articleTitle, articleDate articleContent)
AUTHORS(authorID, authorFname, authorSname,
authorEmail, authorDate)
TOPICS(topicID, topicTitle)
I have created the tables using the following commands:
create table Articles (
articleID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
relAuthorID INT NOT NULL,
relTopicID INT NOT NULL,
articleTitle VARCHAR(200) NOT NULL,
articleDate DATE NOT NULL,
articleContent LONGTEXT
);
create table Authors (
authorID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
authorFname VARCHAR(50),
authorSname VARCHAR(50),
authorEmail VARCHAR(50),
authorDate DATE NOT NULL
);
create table Topics (
topicID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
topicTitle VARCHAR(200)
);
What I am curious about is the articleContent which I have set as LONGTEXT for now.
Obviously an article shall consist of text and some pictures. I know I can store text in the DB but what I was wondering is how to store text AND pictures as just one 'blob' and then simply churn this out into a template HTML file. I have heard of some 'BLOB' type and a few other things. As the site will be quite basic, I am not too bothered about performance overheads regarding the storage of images in the DB, I just want to churn out articles as easily as possible.
Any ideas?
Thanks.
Mak.