Skip to content
Advertisement

How do i link different rows of database into buttons and display the appropriate informations?

Below is the php page and code i created to display information from two rows of the database.

enter image description here

This is the picture of my database.

And this is the code and page where the user will be redirected to after clicking the ‘More Information’ button. enter image description here

What I am actually trying to do is to make the booking page display the correct information within the table and the ‘Terms and Conditions’ for each event by getting the data from the database. I’ve tried few methods but all didn’t seems to work.

Advertisement

Answer

Changes you need, where you are creating the button.

The above code will set the value of the hidden field with the EVENT_ID field in your database. Use this eventId in the next php page to fetch the exact (single) row from the database.

Using the above sql, you will get the data corresponding to the EVENT_ID. Remove the while loop and populate the fields with the fetched data.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement