The best way to do this is to create a table with images that references the article so it will leave you with a database like this:
The table creation script for Images
would be like this:
CREATE TABLE `Images` (
`ImageID` bigint NOT NULL AUTO_INCREMENT,
`ArticleID` bigint NOT NULL,
`Image` longblob NOT NULL,
PRIMARY KEY (`ImageID`)
);
ALTER TABLE `Images` ADD CONSTRAINT `FK_Images` FOREIGN KEY (`ArticleID`) REFERENCES `Articles`(`ArticleID`);
Now all you have to do is insert an image into Images
together with the ArticleID
it belongs to.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…