I have a table where user post articles, however sometimes they post images and some time they don't. I want to display one featured image only from the table below in the homepage and image should always available .
The problem is some articles don't have image and it looks blank. Is there any advice from experts ?
CREATE TABLE `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`a_title` varchar(255) NOT NULL,
`a_description` varchar(400) NOT NULL,
`a_content` text NOT NULL,
`a_views` int(11) NOT NULL DEFAULT '0',
`a_thumbnail` varchar(255) CHARACTER SET latin1 NOT NULL,
`a_image` varchar(255) CHARACTER SET latin1 NOT NULL,
`a_tags` varchar(50) NOT NULL,
`a_author` varchar(120) NOT NULL,
`a_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=utf8