Creating ID's

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

Locked
sk8erh4x0r
Forum Commoner
Posts: 43
Joined: Wed May 26, 2004 8:27 pm

Creating ID's

Post by sk8erh4x0r »

I'm trying to set up ID's for each user on my website. I want it to show as something like .../userinfo.php?ID=user_here

Can someone hook me up with the code for this? I want it to set an ID automatically after someone submits a registratoin form and creates a username for my webpage. Any help would be appreciated. Thanks. :)
Last edited by sk8erh4x0r on Wed May 26, 2004 8:34 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

please don't cross post.

viewtopic.php?t=22117
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Get the id value from the url, use it in a database query and print the results:

Code: Select all

$result = mysql_query("SELECT * FROM users WHERE id = '".$_GET['id']."'");
   $row = mysql_fetch_assoc($result);
   echo "User: ".$row['username']." <br>Date Joined: ".$row['date_joined'];
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

Do not cross post.
Locked