Member hyperlink to display their details

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
brendonknoetze
Forum Newbie
Posts: 5
Joined: Wed Mar 16, 2005 4:50 pm

Member hyperlink to display their details

Post by brendonknoetze »

Hi,
I wonder if any of you might be able to help. I have a seach function on my application that displays the users in my database as a mysql as a table.


I would like the user to select the name, and then it will display their details.

If you think you might have a solution, I would love to hear from you.

Many thanks in advance
Brendon
Image
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

just make the names links with their associative id in a url param. then select off the db for that id from the user table that has more info about the user.

ie:

Code: Select all

<?
while($row = mysql_fetch_assoc($result)){
 echo "<a href=\"users.php?id=".$row['id']."\">".$row['username']."</a><br>";
}
?>
then on users.php

Code: Select all

<?
$getuserinfo = mysql_query("select * from users where id = ".$_GET['id')
  or die(mysql_error());
?>
brendonknoetze
Forum Newbie
Posts: 5
Joined: Wed Mar 16, 2005 4:50 pm

Post by brendonknoetze »

Burrito

Brilliant ! Many thanks, its really quite simple.

Thanks.
Post Reply