alienmojo Posted January 31, 2007 Share Posted January 31, 2007 ok im trying to make a table in which every row is a link to a different pagehere is my code[CODE]mysql_select_db("realestate", $con);$result = mysql_query($SQL);echo "<table border='5'> <tr> <th>Picture</th> <th>Address</th> <th>Price</th> <th>Baths</th> <th>Bedrooms</th> <th>State</th> <th>City</th> <th>Square Feet</th> <th>County</th> <th>Year Built</th> <th>Buy or Lease</th> </tr>";while($row = mysql_fetch_array($result)) { $accountnum=$row['accountnum']; echo '<a href="descrip.php?accountnum='.$accountnum.'">'; echo "<tr>"; echo '<td> <img src="images/'.$row['imagename'].'" width="75" height="75"> </td>'; echo "<td>" . $row['address'] . "</td>"; echo "<td>" . $row['price'] . "</td>"; echo "<td>" . $row['baths'] . "</td>"; echo "<td>" . $row['bedrooms'] . "</td>"; echo "<td>" . $row['state'] . "</td>"; echo "<td>" . $row['city'] . "</td>"; echo "<td>" . $row['squarefeet'] . "</td>"; echo "<td>" . $row['county'] . "</td>"; echo "<td>" . $row['yearbuilt'] . "</td>"; echo "<td>" . $row['buyorlease'] . "</td>"; echo "</tr>"; echo "</a>"; }echo "</table>";[/CODE] Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/ Share on other sites More sharing options...
pocobueno1388 Posted January 31, 2007 Share Posted January 31, 2007 I'm not exactly sure what you are looking for...[code]<?phpmysql_select_db("realestate", $con);$result = mysql_query($SQL);echo "<table border='5'> <tr> <th>Picture</th> <th>Address</th> <th>Price</th> <th>Baths</th> <th>Bedrooms</th> <th>State</th> <th>City</th> <th>Square Feet</th> <th>County</th> <th>Year Built</th> <th>Buy or Lease</th> </tr>";while($row = mysql_fetch_array($result)) { $accountnum=$row['accountnum']; echo '<a href="descrip.php?accountnum='.$accountnum.'">'; echo "<tr>"; echo '<td> <img src="images/'.$row['imagename'].'" width="75" height="75"> </td>'; echo "<td><a href='link.php'>" . $row['address'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['price'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['baths'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['bedrooms'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['state'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['city'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['squarefeet'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['county'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['yearbuilt'] . "</a></td>"; echo "<td><a href='link.php'>" . $row['buyorlease'] . "</a></td>"; echo "</tr>"; echo "</a>"; }echo "</table>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173306 Share on other sites More sharing options...
alienmojo Posted January 31, 2007 Author Share Posted January 31, 2007 did you change anything?? ok its a table and i want each of the rows to be a link to a different page im not getting any errors but when you click on the row nothing happens. i hope that help explain what im doing Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173318 Share on other sites More sharing options...
pocobueno1388 Posted January 31, 2007 Share Posted January 31, 2007 You need to fill in the links with your own links. I just put "link.php" just to show you where it went. Yes, I changed every row to a link. Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173329 Share on other sites More sharing options...
alienmojo Posted January 31, 2007 Author Share Posted January 31, 2007 ok i see what u did not but that is most certainly i snot right that makes every collum on the row in the table a link not make the row a link Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173333 Share on other sites More sharing options...
pocobueno1388 Posted January 31, 2007 Share Posted January 31, 2007 Rows go down, columns go accross...I think you have them confused. What are you having trouble with making an HTML link?<a href="link.php">LINK NAME</a>Thats all it is. Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173336 Share on other sites More sharing options...
alienmojo Posted January 31, 2007 Author Share Posted January 31, 2007 i hate to bust you bubble but a column goes up and down like a pillar Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173343 Share on other sites More sharing options...
Jessica Posted January 31, 2007 Share Posted January 31, 2007 alien is right, rows are horizontal, columns are vertical. tr = table row. Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173344 Share on other sites More sharing options...
pocobueno1388 Posted January 31, 2007 Share Posted January 31, 2007 Oh my, I'm sorry, haha. Maybe I am the confused one.Well...then I did make the links on the columns 0_o Link to comment https://forums.phpfreaks.com/topic/36425-table-row-link/#findComment-173345 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.