I am working on a project for a Database Systems class where we created a database and have to present it somehow. Our group had the idea to create an 'imdb' type website where various information about movies could be stored and presented to the user. We have our database created and are about to begin work on the front-end for the website.
We have some confusion among our group as to how to proceed. We understand that we need to use PHP to connect to the database with the username and password credentials, but from there:
Here are your answers:
Yes- you will need to have the connection on every page. Usually, the connection parameters and script is located in one file which you require on every page.
A query looks like:
SELECT `name` FROM `movies` ORDER BY ID DESC LIMIT 0, 10;
You may find some WordPress plugins which will do something similar. If it's a proof of concept, then I suggest you go this way (if such a plugin exists). It's also a good idea to read extensively on PHP/MySQL development or hire someone who can do that if you want to make that project real.
As itoctopus said, every page will need to connect to the database. I have found the easiest way to accomplish this is to build your db connection in a "header" file (a file that is "included" in every php that needs access to the db).