You have to store an ID field with every record in your user database table and you should make it a primary key with auto_increment enabled. That way whenever a new record is added to your database table, the record will automatically be given a unique id number that will allow you to access it.
Next, when you are creating profile.php, do a check at the top of the page for the presence of an id in the $_GET array, if it exists, escape it to prevent sql injetion and do a mysql query to pull the info you need from that particular user's record. Something like this:
if(isset($_GET['id'])) { //check if id exists in $_GET
$id = mysql_real_escape_string($_GET['id']); //prevent sql injection
$resc = mysql_query("SELECT fldFullName, fldEmail, Password, Gender, DOB FROM Members WHERE id='$id' LIMIT 1"); //query the db for record
if(mysql_num_rows($resc) == 1) { //make sure the user exists
$user = mysql_fetch_assoc($resc); //convert mysql resource into array that can be used throughout your script
} else {
echo "no user with that id";
} else {
echo "no id provided.";
}
Now all your user's info is stored in an array called $user
for use throughout your page.
Then if you want to get fancy with it and better SEO results, look into apache mod_rewrite
module which will allow you to do URL rewriting so that you can have URLs that look like /profile/someusername
rather than /profile.php?id=1234
. Much better!
Here are some resources for getting started with mod_rewrite:
- http://articles.sitepoint.com/article/guide-url-rewriting
- http://www.workingwith.me.uk/articles/scripting/mod_rewrite