Jump to content

[SOLVED] Making mysql query a hyperlink


perficut

Recommended Posts

I have a short program that lists all the data in my database which works great.  What I need help figuring out, is how to make the Company Name a hyperlink, to a file called propertyinfo.php

 

i think its just a matter of adding the html hyperlink tag to the echo line for the company name field, but I can figure out the right syntax to make it work.

 

// Get all the data from the "example" table
$result = mysql_query("SELECT * FROM ILCustomers") or die(mysql_error());


echo "<table align='center' border='0'>";
echo "<tr bgcolor='#ffcc99'> <th>Request Date</th> <th>Business Type</th> <th>Company Name</th> <th>Site Location</th> <th>City</th> <th>State</th> <th>Closed Date</th></tr>";

// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
// Print out the contents of each row into a table
$date_requested=date("F j, Y ", strtotime($row['ReqDate']));
$date_closed=strtotime(date("F j, Y ", strtotime($date_requested)) . " +10 days");
$closed=date("F j, Y ",$date_closed);

echo '<font size="9">'; 

   	echo "<tr align='center', cellspace='2', cellpadding='1', bgcolor='#eeeeee'><td><FONT size=2>";
	echo $date_requested; 
    echo "</td><td><FONT size=2>"; 
	echo $row['Commercial_Type'];
echo "</td><td><FONT size=2>"; 
echo $row['Business_Name'];
echo "</td><td><FONT size=2>"; 
echo $row['Address'];
echo "</td><td><FONT size=2>"; 
echo $row['City'];
echo "</td><td><FONT size=2>"; 
echo $row['State'];
echo "</td><td><FONT size=2>"; 
echo $closed;
     "</td></tr>"; 
} 

echo "</table>";
?>

 

Link to comment
https://forums.phpfreaks.com/topic/179660-solved-making-mysql-query-a-hyperlink/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.