Here is what I am trying to accomplish: When a user logs in, their username will be displayed... Trouble is I am unsure how to co-relate the username w/ the id... thanks for any and all help....

<?php
   require_once('core/db.php');
   require_once('core/secure.php'); 

  $query = mysql_query("SELECT username FROM admin WHERE id = 1");
  $username = mysql_fetch_array($query);
 ?>
<?php echo $username[username]; ?>
<?php
   require_once('core/db.php');
   require_once('core/secure.php'); 

  $query = mysql_query("SELECT username FROM admin WHERE id = 1");
  $result=mysql_query($query);
$username=mysql_result($result,0,"username"); 
?>
<?php echo $username; ?>

Enjoy!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.