Jump to content

Archived

This topic is now archived and is closed to further replies.

waiguru

associating multiple images with one user

Recommended Posts

Hi, i am building an ecommerce application for buying and selling motorbikes with codeigniter where a seller can upload more than image. The images are stored in the base root of codeigniter installation folder in a folder called images whereas the image details are stored in the database together with the user information who uploaded the image. because i want display the images together with their details and the seller details. This will really help me Can you help me? I really appreciate. Thanks.

Share this post


Link to post
Share on other sites

What is the issue exactly?

Share this post


Link to post
Share on other sites

You would have multiple records in your database.

Share this post


Link to post
Share on other sites

Thanks. But that means i will will restrict the users to only a given set of images for example five?

Share this post


Link to post
Share on other sites

But that means i will will restrict the users to only a given set of images for example five?

Is that a question? I don't understand it.

Share this post


Link to post
Share on other sites

My major issue is that i want a user to upload several images which are saved in a folder in the filesystem but when it comes to retrieve the images i cant identify various images with the user who uploaded them. I am building a site to buy and sell motorbikes where images are so crucial. Thanks

Share this post


Link to post
Share on other sites

Have a table in your database that stores the user ID and the filename of the image. Each time someone uploads an image add a row to that table. When you want to display images for a particular user, query the table for the images where UserId=?

Share this post


Link to post
Share on other sites

AKA "foreign key" I believe. As kicken suggested, you need to store all of the references to images in a separate table, then query the table for records that match the user.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.