Once the connection to the database has been made and the forms are all created then next step was for me to use PHP to allow the data in the database to be displayed on the page, which means users would be able view the rooms. This process proved quite difficult for me to complete however with perseverance it was completed.
Below are screen shots of the code that makes the display possible.
The entries into the ‘house’ table of the database are displayed like below on the ‘search’ page of the web application.
Designing A Filter Form
An important function for users to be able to do is to filter the results. There are over 12 different universities listed on our website therefore users would have to search through all results to find a room relevant to them. This is why the filter form is needed on the site to ensure users can access the vacant rooms with ease allowing the sites purpose to be met.
The first step for allowing this was for me to create a filter form in HTML code. Using the same CSS as the other forms on the site this was made easy, I decided to use the ‘select’ tags which created a drop down menu. This made the form look professional and use a small amount of space yet remain effective.
The result is displayed below:
PHP Filter Code
Once the form was created PHP code has to be written which would then allow the connection to the database, this would ensure that users were able to filter the results to their needs.