First-timer with databases plus program review


Within a few of my projects I am currently working on, I am coming across the same problems that will probably be solved with using a database.

My flower-slideshow can upload images by the user, but upon refreshing the page, the images will disappear. Feel free to let me know if there is something wrong with the program at all. I thought to ask for feedback and ask a question in the same post.

The images that are already there are in an images folder in the project, and the sources are in an array. I definitely don’t want to keep it like this.

My random quote generator has its quotes in an array too and I want to change that so I (and maybe the user) can easily add more quotes in the future.

The thing is, I have never used any sort of database in a project before. I have had some experience with MongoDB and SQL, but just in tutorials. Someone mentioned this and I was wondering if this is the way to go.

Thank you!

Yes, you need to store somewhere all the photo filenames/path used in the slideshow if you want users to be able to add, edit, delete from the set. That can be a real database (mySQL, MSSSQL), or some XML/JSON text file saved on a subdirectory – though in this case since this is hosted github, I doubt they’ll allow you public write-permissions to their directory.

That mLab seems interesting, you can try that.