View Full Version : dynamic details page pulling from sql table

01-24-2012, 11:44 PM
I've scoured the web for a tutorial about this, but to no avail. And so I turn to you helpful comrades. Here's what I need to do:

I have a MySQL database with an Events table. I have already created a PHP web page with a list of the Event titles and some summary info example here: http://www.hedgevent.com, Each event title must be a link to the full details of the Event. But I want to avoid having to create a static page for each event.

Is there a way to have the event name be added to the end of the url and the data to be pulled to appear in the spaces i have made on my sample details page?

<div id="container">
<div id="listing">

<h2>Activist Investor Conference</h2><br>
<table width="500" border="0" cellpadding="5">
<td>Outlook | Google | Apple iCal | Yahoo | MSN</td>
<td>Linkedin | Facebook | Google+ | Twitter | Stocktwits</td>
<td>Waldorf Astoria</td>
<td>123 Central Park Lane - New York NY 11298</td>

<p>Details:</p> <br>
<p>The Activist Investor Conference is your opportunity to network with the most important group of activist investors, corporate governance specialists, advisory firms, proxy solicitors, and corporate board members. This two-day event features a complete view of activist investment strategies and their impact on corporate performance and returns. The agenda examines topics vital to both investors and corporate boards.

01-24-2012, 11:54 PM
Yup. Appending a query string to the URL will send information into the $_GET superglobal. Then, you just pull the event name (or id) and get it from whichever place you've stored the data, most likely a database.


Although that shows you an example in a form submission context, the form is not necessary; it's the url query string that is important (index.php?something=value&somethingelse=anothervalue).

If you do end up using mysql, remember to use mysql_real_escape_string to stop mysql injection :thumbsup: