0

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]; ?>
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by ryan_vietnow
1
<?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!

This question has already been answered. 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.