Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Banned
    Join Date
    May 2008
    Posts
    105
    Thanks
    9
    Thanked 0 Times in 0 Posts

    PHP Login Script QUESTION

    Hello

    PHP Code:
    <?

    /**
     * Connect to the mysql database.
     */
    $conn mysql_connect("localhost""my_username""my_password") or die(mysql_error());
    mysql_select_db('my_database'$conn) or die(mysql_error());

    ?>
    This isn't working. (I have put things like "my_username" because i don't want to put my details)

    It comes up with:

    PHP Error Message

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a8546868'@'localhost' (using password: YES) in /home/a8546868/public_html/database.php on line 6

    Free Web Hosting
    Access denied for user 'a8546868'@'localhost' (using password: YES)

    That is what comes up. Does anyone know what is happening?

    Thank You
    9homie

  • #2
    LAMPE
    Guest
    you have the wrong username or password

  • #3
    Banned
    Join Date
    May 2008
    Posts
    105
    Thanks
    9
    Thanked 0 Times in 0 Posts
    no i don't... That is the problem...

  • #4
    LAMPE
    Guest
    Well that's the error you get when a username and password don't match up.

    Just to verify: I copied pasted your script with my own database details and it worked fine.
    Last edited by LAMPE; 05-18-2008 at 06:33 PM.

  • #5
    Banned
    Join Date
    May 2008
    Posts
    105
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Hmm... I wonder what has happened...

    With the database name, did you pt the whole database name up or did you just put the actual table name?

  • #6
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    For the mysql_select_db(); you put the database name, not the table name. Is your username/password in the correct case? Are you using the correct host? Usually it is "localhost" online.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #7
    Banned
    Join Date
    May 2008
    Posts
    105
    Thanks
    9
    Thanked 0 Times in 0 Posts
    I think i have done it, because it is not localhost for mine, it is something else and i was using localhost, so i will say *RESOLVED* in the next post of mine if it has worked...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •