Connecting the Database // Displaying Results.

Connecting the Database

To display the results on to the webpage we first had to connect the database from MyAdmin to the webpage. Once connected we would hope that it would it would relay the results from the table on to the website depending on the filter that they have chosen. To do this we have to use a php code which is down below.



Displaying results

The code displayed below allows the results to be shown on the webpage, this particular bit of code allows the house table to be shown wherever we choose on the page. In this case we choose the search page.


This is what the code appears like with a bit of added css;




Creating a Filter Form

As a group we decided that we should filter the houses that are in the database via university. What we wanted was to allow a drop down menu to appear and the user to choose the uni, then using a php code filter the ones out that is relative to the chosen option.

To start of to complete this you first have to make a HTML form. This will create the drop down menu and allow the user to choose the university from the ones that are available to be chosen. This is why a drop down menu is so effective as it allows the user to choose from a select number of unis while also looking simple and use minimal space.



After all the HTML form was completed and working we then put the php filter code into brackets, this will hopefully allow us to filter the universities and in turn making it easier for the user to find a house they are wanting to rent.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s