954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

User Profile PHP

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.:)

ale89
Newbie Poster
10 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

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

if($_SESSION['username'] && isset($_POST['edit'])){
P0lT10n
Posting Whiz in Training
235 posts since Apr 2010
Reputation Points: 13
Solved Threads: 30
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: