It will not work when some people have their own file. I need a code that will show the user their files and they will download it<a href="/images/myw3schoolsimage.jpg" download>
<img border="0" src="/images/myw3schoolsimage.jpg" alt="W3Schools" width="104" height="142">
You must set properly your database structure first.I have one directory only, And each file has an id (In database) and each users has own file, now I want to show the users file based on its ID. So this will happen Id (of user) == id (of file).
You are absolutely right.You must set properly your database structure first.
1 user can have multiple files, right?
So based on that, let's say you have a table on your database named "files", and its columns are "id", "user_id", etc..
Then you just need to query on your database like this "Select * from files where user_id = 1" (let's say user's id is 1).
Then it will give the files of a specific user. With that, you can loop or its up to you if the response from that query is an array or not.
<a href="/uploads/file1.png" download>Download file</a>
|Thread starter||Similar threads||Forum||Replies||Date|
|❓ASK A Bitcoin Early Developer Said Satoshi Nakamoto Sought Help||Bitcoin Forum||19|
|❓ASK Help to find a better WordPress hosting||Domains & Web Hosting||4|
|Does large back-link website help or not really?||Search Engine Optimization||3|
|Freebies Personal Development: Free 30 minute Skype call/consultation to help you plan your goals.||Freebies & Giveaways||1|
|offering payment in crypt for php code help||Design & Programming||0|
|❓ASK A Bitcoin Early Developer Said Satoshi Nakamoto Sought Help|
|❓ASK Help to find a better WordPress hosting|
|Does large back-link website help or not really?|
|Freebies Personal Development: Free 30 minute Skype call/consultation to help you plan your goals.|
|offering payment in crypt for php code help|
We help each other to make money online. Get a beer and register with us, learn how we make a full-time job working from home like a boss. Looking to Donate?
Earnings Disclaimer: All the posts published herein are merely based on individual views, and they do not expressly or by implications represent those of BeerMoneyForum.com or its owner. It is hereby made clear that BeerMoneyForum.com does not endorse, support, adopt or vouch any views, programs and/or business opportunities posted herein. BeerMoneyForum.com also does not give and/or offer any investment advice to any members and/or it's readers. All members and readers are advised to independently consult their own consultants, lawyers and/or families before making any investment and/or business decisions. This forum is merely a place for general discussions. It is hereby agreed by all members and/or readers that BeerMoneyForum.com is in no way responsible and/or liable for any damages and/or losses suffered by anyone of you.