| | |
Display Username
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 74
Reputation:
Solved Threads: 5
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 Syntax (Toggle Plain Text)
<?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 Syntax (Toggle Plain Text)
<?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!
![]() |
Similar Threads
- Simple login (read data through txt file) (Visual Basic 4 / 5 / 6)
- Forbidden | You don't have permission to access /~username on this server. (Linux Servers and Apache)
- Change display name? (Geeks' Lounge)
- PHP Help - Display forum online and total members on main page (PHP)
- ASP.NET how can i display the logod user Status (ASP.NET)
- Help with asp form will not display contact information (ASP)
- radio button no display?? (ASP)
- Refresh Form to Display changes (MySQL)
- winxp pro internet display problem (Windows NT / 2000 / XP)
- vnc between linux and windows (*nix Software)
Other Threads in the PHP Forum
- Previous Thread: File Upload Variables
- Next Thread: browser detect
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parameter parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube





