Devi creare una tabella con un auto_increment DELL'ID, POI QUANDO UNA PERSONA FA IL LOGIN RICAVI LA SESSIONE E NELLE ALTRE PAGINE METTI session_start();
Ti Potrebbe essere utile :
Codice PHP:
<?php
        
if(isset($_SESSION['username'])) {
        
$user_for_id $_SESSION['username'];
        
$sel_my_id mysql_fetch_array(mysql_query("SELECT * FROM users WHERE username='$user_for_id'"));
        
$my_id $sel_my_id['id'];
                echo <<<EOT
                [url="richieste.php"]Richieste[/url] [url="directory/people/"]Persone[/url] <span id="tp">Il Mio Profilo</span> [url="logout.php"]Logout[/url]
EOT;
        } else {
                echo <<<EOT
                [url="index.php"]Login[/url] [url="index.php"]Registrati[/url] [url="directory/people/"]Persone[/url] <span id="tp">La mia pagina</span>
EOT;
        }
        
?>
        
        <?php

require "settings.php";

$id $_GET['id'];

if(!
$id || !is_numeric($id)) { header('Location: profile.php'); }

    
$sel_info mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='$id'"));

$username $sel_info['username']; 
$cognome $sel_info['cognome']; 




?>