perficut Posted October 30, 2009 Share Posted October 30, 2009 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 More sharing options...
Bricktop Posted October 30, 2009 Share Posted October 30, 2009 Hi perficut, Change the relevant code to read: echo '<a href="propertyinfo.php">'.$row['Business_Name'].'</a>'; Hope this helps. Link to comment https://forums.phpfreaks.com/topic/179660-solved-making-mysql-query-a-hyperlink/#findComment-947965 Share on other sites More sharing options...
perficut Posted October 30, 2009 Author Share Posted October 30, 2009 Thank you. I almost had it but I couldnt get the '.' to work in the link. Thank you so much. Link to comment https://forums.phpfreaks.com/topic/179660-solved-making-mysql-query-a-hyperlink/#findComment-947969 Share on other sites More sharing options...
Bricktop Posted October 30, 2009 Share Posted October 30, 2009 You're very welcome Link to comment https://forums.phpfreaks.com/topic/179660-solved-making-mysql-query-a-hyperlink/#findComment-947971 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.