jeudi 30 avril 2015

Storing files in a database vs. a file system with PHP/MySQL

First off, I'm new to both PHP and MySQL, so I apologize for anything obvious I haven't yet found in my research.

I'm developing a lesson plan database that lets users search for lesson plans by record and will eventually allow uploading/downloading of various file formats to and from that lesson (record). Newly created lesson plans will need to have a new profile/database to store their own files and probably a new web page to navigate to...I can imagine this will get out of hand very quickly.

For example, I create a lesson with the name "Easy_as_123", subject as "Math", and grade as "1". Creating this record should then allow navigation to this lesson to add a textarea description and upload associated files available for download. I'm guessing the file sizes will be under 1MB. I'm hearing both filesystem and database is a valid option. Is there a sound way to do this with PHP/MySQL?

My problem is, I don't know how to go about storing the files so that they are referenced by the records. Do I need to create a separate database for each record and link it to that record?

Any help is appreciated




Aucun commentaire:

Enregistrer un commentaire