webtech123 Posted June 19, 2008 Share Posted June 19, 2008 Im in desperate need of help, Ive been downloading scripts for ages now and can't find a single one to do what i want it to do!!!!!! I just need a user to be able to upload a images (10) then retrive them by way of their user id. This is the only piece of php/mysql that ive ever got stuck with, can someone please help? Regards, James Quote Link to comment https://forums.phpfreaks.com/topic/110954-mysql-image-uploadretrive/ Share on other sites More sharing options...
ober Posted June 19, 2008 Share Posted June 19, 2008 Where are you storing the images? How are you storing them? How are you trying to get them out? Can you confirm that the upload is successful and the file is present? Quote Link to comment https://forums.phpfreaks.com/topic/110954-mysql-image-uploadretrive/#findComment-569264 Share on other sites More sharing options...
webtech123 Posted June 19, 2008 Author Share Posted June 19, 2008 I have tried storing them in BLOB's but to no success, i dont know how to store them on the server then point it to a users account. Sorry not very helpful am I !! I can upload a file to the server but i can't attach it to a users profile Quote Link to comment https://forums.phpfreaks.com/topic/110954-mysql-image-uploadretrive/#findComment-569274 Share on other sites More sharing options...
ober Posted June 19, 2008 Share Posted June 19, 2008 Do not store them in the database. That's a complete waste of time and DBMS resources. When you upload them to the server, simply append an ID to the front of the filename: 1234_pic_of_my_dog.jpg Then you have a table in the database like this: user_id | media_id 1 1234 1 2345 2 8942 etc. Then when you need to display them, simply get all the ids for the user out of the table and go retrieve all the files that start with media_id_. Quote Link to comment https://forums.phpfreaks.com/topic/110954-mysql-image-uploadretrive/#findComment-569282 Share on other sites More sharing options...
webtech123 Posted June 19, 2008 Author Share Posted June 19, 2008 Ok thanks, i will give it go. Thanks again Jame Quote Link to comment https://forums.phpfreaks.com/topic/110954-mysql-image-uploadretrive/#findComment-569297 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.