phpnoobie9 Posted February 28, 2008 Share Posted February 28, 2008 I have the names listed as a link through a loop. <?php while($whileloop = mysql_fetch_array($catresults)) { ?> <a href="#"><?php echo $whileloop['name'].'<br />'; ?></a> <?php } ?> When I click the link..how do I get it to display some information from the row? Quote Link to comment Share on other sites More sharing options...
haku Posted February 28, 2008 Share Posted February 28, 2008 First: get rid of the br tag. You don't need it, and its not doing anything for you. Second: what information do you want to display, where do you want to display it, and how do you want it displayed? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 28, 2008 Share Posted February 28, 2008 You need to use a $_GET statement. So your URL should be mypage.php?name=joe Then you use $_GET['name'] You would then query your DB on that name and retrieve/display whatever info you're looking for. Quote Link to comment Share on other sites More sharing options...
deansatch Posted February 28, 2008 Share Posted February 28, 2008 Best off using id in case of two names the same: <ul> <?php while($whileloop = mysql_fetch_array($catresults)) { $name = $whileloop ["name"]; $id= $whileloop ["id"]; echo"</li><a href=\"details.php?id=$id\">$name</li></a>"; } ?> </ul> 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.