Need Help in Access Error

Discussion in 'Programming' started by AimyThomas, Sep 20, 2012.

  1. #1
    Hello Again,

    Please help with this link problem.

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myuser'@'localhost' (using password: XYZ@123)


    <?php
    function connectTo() {
    $host = "localhost";
    $db_name = "myDB";
    $username = "myUser";
    $password = "passs";
    $link = mysql_connect("$host", "$username", "$password", "$db_name");
    return $link;
    }
    ?>

    in another file is this line

    $link = connectTo();

    Thanks in advance
     
    AimyThomas, Sep 20, 2012 IP
  2. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #2
    EDIT: seems I got it wrong... but you asked your question on another forum, and someone answered....

    http://www.websitebabble.com/html-php-css-javascript-coding-programming-topics/26741-need-help-access-error.html
    Code (markup):
     
    Last edited: Sep 21, 2012
    GMF, Sep 21, 2012 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    Try
    
    $link = mysql_connect($host, $username, $password);
    mysql_select_db($databasename, $link);
    
    PHP:
     
    Rukbat, Oct 1, 2012 IP