View Single Post
Old 02-18-2006, 09:58 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
make a field in the database for a 'user_id'. set the field as an integer, auto-increment, and primary key.

this will make it so every new person will get assigned a new user id.

if you are using PHP, then you would make a page that gets the user info based of their userid. the URL might look like this: http://example.com/profile.php?id=234

so then, you could create a list of links to user profiles like this:
PHP Code:
<?
$result 
mysql_query("select user_id, name from users");

while (
$row mysql_fetch_assoc($result)) {

  echo 
"<a href='http://example.com/profile.php?id={$row['user_id']}'>{$row['name']}</a><br />\n";
}
?>
on your profile.php page, you will need to query based off the $_GET['id'] variable.
Code:
$result = msyql_query("select * from users where user_id='" . mysql_real_escape_string($_GET['id']) . "'");
sde is offline   Reply With Quote