Page 1 of 1

Member hyperlink to display their details

Posted: Tue Apr 12, 2005 5:38 pm
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

Posted: Tue Apr 12, 2005 5:44 pm
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());
?>

Posted: Tue Apr 12, 2005 5:48 pm
by brendonknoetze
Burrito

Brilliant ! Many thanks, its really quite simple.

Thanks.