Richie1209 Posted January 12, 2021 Share Posted January 12, 2021 (edited) I want to create a media library in the CMS, similar to how it is in WordPress but custom-coded in PHP on my own site. Can this be done simply with a database connection or will the images need to be uploaded to a server? Bit confused as to how it works and which is the best way to go about it. Thanks for any help. Edited January 12, 2021 by Richie1209 Quote Link to comment https://forums.phpfreaks.com/topic/311997-how-to-create-a-media-library/ Share on other sites More sharing options...
Barand Posted January 12, 2021 Share Posted January 12, 2021 (edited) You can store images in a database but it's not advised. Best way is store the image file in the file system and store the image location and metadata in the database. Edited January 12, 2021 by Barand Quote Link to comment https://forums.phpfreaks.com/topic/311997-how-to-create-a-media-library/#findComment-1583748 Share on other sites More sharing options...
JacobSeated Posted January 27, 2021 Share Posted January 27, 2021 You do not need a database at all. In fact, it is sometimes faster to not use a database, since it takes extra time to establish a database connection (unless it is hosted on the same server). I already tried this. The code is placed on GitHub under Apache license, maybe you can use it in your project. It only uses build-in features of PHP and gd library. Available here: https://github.com/beamtic/php-photo-gallery The project has not been updated for awhile, but still got some features planned, including a Wordpress plugin. Quote Link to comment https://forums.phpfreaks.com/topic/311997-how-to-create-a-media-library/#findComment-1584044 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.