I have 3 database tables as follows :
users -> (user_name , user_password, user_email )
posts ( post_id , user_name, post_date, post_title, post_content )
commments( comment_id , post_id , user_name , comment,ip_address )
Now I want to add the ability to embed images inside a post( and not just upload to 开发者_JAVA技巧the webserver ) . I don`t want to store the images inside the database .only their pointers?
How can this be done ? Thankx!
The easiest solution would be going for a CMS like wordpress which provides support for users/post/comments and image library, and allows you to edit and embed all kind of useful resources in posts. If you want to develop your own solution that's another story, but might prove a bit more time consuming.
You need to consider how many images,what sizes would you allow for your posts and many other aspects. Also easiest way to embed images would probably be adding <img>
tags in your content. So another question would be in what format is the post_content? Pure text or HTML?
A very good example of embedding images are forum posts might want to check how those work as well.
精彩评论