
November 15th, 1999, 01:09 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
I'm trying to insert a link into a table that is generated through a MySQL Query.
Here's the code:
<?
error_reporting(0);
include "auth.php";
MySQLConnect("Error Connecting",
"Temporarely unavailable.");
$result = MySQLQuery("select * from bizfile order by name",
"Error Selecting",
"Temporarely unavailable.");
// create header row
print("<tr>n");
print("<td><b>Name</b></td>n");
print("<td><b>City</b></td>n");
print("<td><b>Type</b></td>n");
print("</tr>n");
// get each row
while($row=mysql_fetch_array($result))
{
$id=$row[0];
$name=$row[1];
$city=$row[2];
$type=$row[3];
print("<tr>n");
print("<td>$name</td>n");
print("<td>$city</td>n");
print("<td>$type</td>n");
print("<tr>n");
}
?>
What I'd like is a link at the end of each table row which would load a page with information relevant to that database row. For example, if the main table lists business establishments, the link would set-up a page which includes the businesses address as well as relevant financial information.
I tried inserting into the prints the following line:
print("<td><a href="$id.htm"> Test </a></td>n");
but.... didn't work
Can anyone help???
Thanks in advance....
|