Hi everyone,
I'm still somewhat new to PHP (but learning quickly, of course) so this question is probably plain old stupid, but here goes.
I have a PHP page that connects to a SQL database and grabs one specific row of information from a table (based on the date, which is the first field) and puts it in various places on the page. It's basically a press release page. The dynamic parts of the page are what come from the SQL database, such as the title of the story, the body copy, etc. I built it and it works fine, however...
I want the user to be able to jump from one press release to the other, so I built a table that lists all of the titles of each story and wrote code to create <a> tags for the links around each title. I know this is confusing and I apologize.
Basically, my question is this. What do I need to put inside the anchor tags to make the page reload and have all of the dynamic content change when the user clicks one of the links to another story? Right now, I have something like this:
<a href="press_releases.php?currentdate=20030326">Organization X Hits a Homerun at Seybold</a>
The date, seen as 20030326, is dynamic and comes from the first column in the database, but when I click links with various dates, such as the example above, nothing happens when the page reloads...the content is simply static. I have a variable called $currentdate, which I set near the beginning of the PHP file. It is set to the most recent date for now (which may or may not change later). What I'm doing now is trying to change the $currentdate variable, when the user clicks a different link, with the <a> code I pasted above, but I'm not really sure what the hell I am doing here. Evidently, one of two things is true: 1) using the anchor tag syntax above does not change the value of $currentdate, or 2) changing $currentdate isn't what is going to determine which row of the database the information comes from. Any thoughts?
Thanks A LOT!
-Benny