how to store image in a folder and database using php and mysql and how to retrieve that image.

Recommended Answers

All 3 Replies

So you want to have a user upload an image that will be stored in a folder and then recorded in a database? Then you want code to be able to retrieve that image? Is that correct?

If that is the case then you need a bog standard upload script, accept from in the success block of code you will need to run some queries that will store the name of the file in the database along with any other information about the file you may need.

As for retrieving the file you just need to use a get to pass the ID of the file and then run a query using the GET variable and the n display all information about the file and passably a download link.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.