I am assuming you have another application that you are trying to integrate into my script somehow?
If you know the username of a user you can easily find the ID and vise versa, assuming both scripts are running on a shared database. So, say you know the username of a user and you want to get their ID number, which is what I assume you want to do.
You would do:
PHP Code:
$username = "Username Goes Here";
$username = mysql_real_escape_string($username); //Prevent against SQL injection
//SQL query to get the ID number based on a username
$query = "SELECT * FROM users WHERE username = '".$username."'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$uid=@mysql_result($result,$i,"uid");
$i++;
}
//Now we have the user's ID number, so we make a link...
echo "<a href='viewprofile.php?id=".$uid."'>Click Here</a>";
I hope this helps. If this isn't what you need please give me more info / examples of what you want to do and I'll try and help as best I can.
Brandon