Jump to content

Help linking query results to another page?


The.Pr0fess0r

Recommended Posts

Hello,

 

I have a query that outputs 5 columns of data. The first column is the date the trip was taken. I would like to be able to click on that date and have it take me to another page where it shows me all the info about that trip.

 

The problem I am having is that I cannot get the syntax correct.

 

Here is my line of code that I would like linked to another page:

echo '<td width="50" align="right">' . substr($row['date_of_hunt'],0,10) . '</td><td width="20"></td>';

 

The page I want it linked to is trip.php I am using the field id in database. So i'm assuming it would be something like: trip.php?id=$row['id]..but I'm not sure how to put it all together.

 

Any help would be greatly appreciated!

Link to comment
Share on other sites

Thank you very much! I had to remove the set of parenthesis just after the = but then it started working.

 

Now I am having problems getting the data to show on the resulting page. What do I have to use to get the data to show up on the trip page?

 

I have the page set up the way I would like with the column headers (i.e. date of trip, hunters, etc) but the data will not show up. I know there is something I have to add to tell it where to pull it from, but i'm not sure what that statement is? If I just put

<?php $date_of_hunt >?

in a column, nothing shows up. How do I get it to pull the data?

 

For example, on the report page (from the earlier post) let's say I click on the date with the id of 3...so my url looks like: http://www.mysite.com/trip.php?id=3. How do I get it to show the information from id 3?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.