If you'd like to show a set of images with your post, you'll need to store those images in a table along with the post id that they are associated with.
Upon submitting your form you're probably handling the post data via $_POST
. Your images will come across under $_FILES
. Once you have performed an insert on your post table, you can call mysql_insert_id()
to get the new primary key ID for that post.
The post id can be stored in your images table along with references to your various images. I'm assuming here that you aren't generating your own post id's, however if you are you'd use that instead.
See also Handling File Uploads, on php.net.
Whenever you're querying your database to show the post to your readers, perform a JOIN on the images table based upon a common post id, and you'll have the paths to all related images.
See also Understanding JOINs in MySQL and Other Relational Databases, on sitepoint.com.