I’m having some trouble trying to figure out how to make a link out of a table with mysql data.
What I have is a table from a mysql database from a job application. The table only contains basic information of the applicant’s id, name and contact info. I’d like to have the ID as a link that would lead the user to a page that has the detailed information from the job app. So far I have both pages, I just need to figure out how to do that link with the ID.
Here’s the table page where I would like to have the ID link.
[php]
| ID | Name | Address | City | State | Zipcode | Phone |
|---|---|---|---|---|---|---|
| " . $row['id'] . " | "; echo "" . $row['first'] . " " . $row['middle'] . " " . $row['last'] . " | "; echo "" . $row['address1'] . ", " . $row['address2'] . " | "; echo "" . $row['city'] . " | "; echo "" . $row['state'] . " | "; echo "" . $row['zip'] . " | "; echo "" . $row['phone'] . " | "; echo "
[/php]
Here’s the php that it should be linked to. Here it’s the number 4 but I’d like it to be the variable that’s passed.
[php]
<?php mysql_connect("localhost","user","pass") or die(mysql_error()); mysql_select_db("user") or die(mysql_error()); $result = mysql_query("SELECT * FROM jobapp WHERE id='4'") or die(mysql_error()); $row = mysql_fetch_array( $result ); ?>[/php]
So, in essence, I’m not sure how to pass a variable from one page to the next. Do you do it in a hidden form or can you pass it in some other way? Thanks!