Hi there, Basically I want to create a script for my website that will print out the admin names and passwords. The table is called user under mysql. Currently I have something like this however it doesn't work: Code: <? $host = 'localhost'; $user = 'root'; $pass = ''; mysql_connect($host, $user, $pass) or die ('Error'); @mysql_select_db('mysql'); $query="select users"; $rt=mysql_query($query); echo mysql_error(); while($nt=mysql_fetch_assoc($rt){ echo "$nt[first_name] $nt[second_name]<br>"; } mysql_query($query); mysql_close(); ?>
No expert but have you looked at your query, you need to put FROM<tablename> where you are selecting users from. Code: $query="select * FROM users";
Note that you won't get the actual passwords from the user table in the mysql DB - they're all one-way encrypted so you'll only get the hash value returned .