0

Hi everyone!
How is everybody?
Help me modify this code to show a user profile.
I need to show all the data but do not know how to put in the code to display data and other insurance I have to change the sql query.
If the logged sample data and an edit button but this only shows the data logged.
On aggregate only is the connection to the database.
This is my PHP code:

<?php 
              include_once ('./global.php'); 
              if($_SESSION['username']){ 
$result = mysql_query('SELECT * FROM users WHERE username = "' . $_SESSION['username'] . '"'); 
$usuario = mysql_fetch_array($result); 
mysql_free_result($result); 
 echo   $username['username']; 
echo    $nombre['nombre']; 
echo '<a href="editar.php">Modificar perfil</a>'; 
              }else{ 
                  $result = mysql_query('SELECT * FROM users WHERE username = "' . $_SESSION['username'] . '"'); 
$usuario = mysql_fetch_array($result); 
mysql_free_result($result); 
 echo   $username['username']; 
              } 
               ?>

If I can help I thank you!
Thanks.:)

2
Contributors
1
Reply
8
Views
7 Years
Discussion Span
Last Post by P0lT10n
0

If you depend on a button call edit, put in the if, this

if($_SESSION['username'] && isset($_POST['edit'])){

Edited by P0lT10n: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.