frank_solo Posted March 21, 2011 Share Posted March 21, 2011 I have a table where it displays some data. How do I make this echo "<td>" . $row['title'] . "</td>"; into a link? Link to comment https://forums.phpfreaks.com/topic/231232-how-do-i-make-a-column-link-to-mysql/ Share on other sites More sharing options...
JohnOP Posted March 21, 2011 Share Posted March 21, 2011 echo "<td><a href='" . $row['title'] . "'>link</a></td>"; Link to comment https://forums.phpfreaks.com/topic/231232-how-do-i-make-a-column-link-to-mysql/#findComment-1190118 Share on other sites More sharing options...
frank_solo Posted March 23, 2011 Author Share Posted March 23, 2011 Thanks JohnOP for the response. I got it to link to another page like so echo "<td bgcolor='#FFFFFF' style='color: #000' align='center'><a href='classified/searchapts/index.php'" . $row['title'] . "'>".$row['title']."</a></td>"; My second question is how do i start to show the data on the href page for the item in the row. What function can I use or does anyone know of a good tutorial? Link to comment https://forums.phpfreaks.com/topic/231232-how-do-i-make-a-column-link-to-mysql/#findComment-1191388 Share on other sites More sharing options...
frank_solo Posted March 24, 2011 Author Share Posted March 24, 2011 Ok so where can I put this " . $row['title'] . " in this echo "<td bgcolor='#FFFFFF' style='color: #000' align='center'><a href='index.php?id=$title'>$title</a></td>"; Link to comment https://forums.phpfreaks.com/topic/231232-how-do-i-make-a-column-link-to-mysql/#findComment-1191617 Share on other sites More sharing options...
frank_solo Posted March 24, 2011 Author Share Posted March 24, 2011 Ok I figured how to insert it to this echo "<td bgcolor='#FFFFFF' style='color: #000' align='center'><a href='classified/searchapts/index.php?id=$title'>" . $row['title'] . "</a></td>"; but now what do I write in the page. In this case index.php to display the info of that row is it this <?php include "dbaptsConfig.php"; $query = mysql_query("SELECT * FROM apartments WHERE title ='$title'"); while($row = mysql_fetch_array($query)) { echo $row['title']; echo '<br>'; echo $row['town']; echo '<br>'; echo $row['rooms']; echo '<br>'; } ?> Link to comment https://forums.phpfreaks.com/topic/231232-how-do-i-make-a-column-link-to-mysql/#findComment-1191619 Share on other sites More sharing options...
frank_solo Posted March 24, 2011 Author Share Posted March 24, 2011 Please I need help? Link to comment https://forums.phpfreaks.com/topic/231232-how-do-i-make-a-column-link-to-mysql/#findComment-1191739 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.