I want to store data of news Feed . News feed contains image , video , audio , text . How to store all these together in database ?
I have table
post(postid , userid , post_content , post_time);
For Video ,audio and image we are using directory For every user. So when ever they will upload video , audio , image then this will be stored in their directory . But how to put all these together in database . So that we can apply classes to style image , text e.t.c , I am unable to combine all these and put together so that this it can be stored in Database as content.
I have idea like this
post(postid , userid , text_content , post_type , post_time);
post_image(id , postid , path);
post_video(id , postid , path );
post_audio(id, postid , path );
post_type is used for image = 0 , video = 1 and audio =2 assuming user can post only one of them either image or video or audio .
Is this a good idea to store News Feed in database . Any help will be appreciable .
I am using PHP , MYSQL , Apache .