waiguru Posted August 5, 2013 Share Posted August 5, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/ Share on other sites More sharing options...
trq Posted August 5, 2013 Share Posted August 5, 2013 What is the issue exactly? Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443594 Share on other sites More sharing options...
waiguru Posted August 6, 2013 Author Share Posted August 6, 2013 The issue really is associating multiple images with one seller Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443625 Share on other sites More sharing options...
trq Posted August 6, 2013 Share Posted August 6, 2013 You would have multiple records in your database. Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443657 Share on other sites More sharing options...
waiguru Posted August 6, 2013 Author Share Posted August 6, 2013 Thanks. But that means i will will restrict the users to only a given set of images for example five? Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443668 Share on other sites More sharing options...
trq Posted August 6, 2013 Share Posted August 6, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443760 Share on other sites More sharing options...
waiguru Posted August 7, 2013 Author Share Posted August 7, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443798 Share on other sites More sharing options...
kicken Posted August 7, 2013 Share Posted August 7, 2013 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=? Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1443799 Share on other sites More sharing options...
sKunKbad Posted August 30, 2013 Share Posted August 30, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/280856-associating-multiple-images-with-one-user/#findComment-1447414 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.