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] Quote Link to comment 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] Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.