1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Help

Discussion in 'HTML, Graphics & Programming' started by triggerthat, 11 May 2006.

  1. triggerthat


    Joined: 26 Aug 2005

    Posts: 6,870

    Location: London

    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:

    $host = 'localhost';
    $user = 'root';
    $pass = '';
    mysql_connect($host, $user, $pass) or die ('Error');
    $query="select users";
    echo mysql_error();
    echo "$nt[first_name] $nt[second_name]<br>";
  2. ArmoVanBuuren


    Joined: 19 Mar 2005

    Posts: 569

    No expert but have you looked at your query, you need to put FROM<tablename> where you are selecting users from.

    $query="select * FROM users";
  3. Augmented


    Joined: 18 Oct 2002

    Posts: 5,464

    Location: London Town

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