Forum Moderators: coopster
$job_description = $_GET['job_description'];
?>
now....my original page that I'm having trouble with is this:
<table border="1">
<tr>
<th>Location</th>
<th>Job Name</th>
<th>Effective Date</th>
</tr>
<?php
//Include our login information
include('db_login.php');
// Connect
$connection = mysql_connect("mydatabase", "user", "pass");
if (!$connection){
die("Could not connect to the database:
<br />". mysql_error());
}
// Select the database
$db_select = mysql_select_db("orchardweb"); if (!$db_select){
die ("Could not select the database:
<br />". mysql_error());
}
// Assign the query
$query = "SELECT * FROM hr";
// Execute the query
$result = mysql_query($query);
if (!$result){
die ("Could not query the database:
<br />". mysql_error());
}
// Fetch and display the results
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$location = $row["location"];
//HERE'S THE PROBLEM $job_name = '<a href=job.php"' . $row['job_description'] . '">' . $row['job_name'] . '</a><br />';
$effective_date = $row["effective_date"];
echo "<tr>";
echo "<td>$location</td>";
echo "<td>$job_name</td>";
echo "<td>$effective_date</td>";
echo "</tr>";
}
// Close the connection
mysql_close($connection);
?>
</table>
</body>
</html>
Unless the job description starts with a question mark you need the one above. You may also need to urlencode [us3.php.net] $row['job_description']. Personally I would use a shorter identifier, like a unique record id for the table, instead of [what I would guess to be] a longer text string as a parameter.
Also, although you can technically do it that way, you want to set it up as a variable=value sort of thing, like
<a href=job.php?detail=' . $row['job_....
Otherwise it's a bit trickier to get it back out on the other end.