Hi Forum Members,
I need some help, I have a query that selects data from two tables (companyinfo and services) with the "services" table containing an unique id. I'm trying to generate a hyperlink of the results row that will take a user to a "details page" when clicked. My problem is, I can't seem to generate the url with the table id="xxx" to pass to the details.php page (i.e. mydomain.com/details.php?id=xxx).
Currently the code produces: mydomain.com/details.php?id=
Any guidance will be much appreciated.
<?php
// MySQL Connection items
$query = "SELECT services.id, companyinfo.company, services.services, services.price, services.timestamp ".
"FROM companyinfo, services ".
"WHERE companyinfo.username = services.username";
$result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($result);
echo "<table id='tablecss'>\n";
echo "<tr> <th>ID</th> <th>Company</th> <th>Type of Service</th> <th>Price</th> <th>Posted On</th> </tr>";
// echo out the contents of each row into a table
while ($get_info = mysql_fetch_row($result))
{
echo "<tr>\n";
foreach ($get_info as $field)
{
echo "\t" . '<td><a href="details.php?id="> '. $id .' ' . $field . '</a></td>' . "\n";
}
echo "</tr>\n";
}
echo "</table>\n";
?>