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 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    52
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Error while running mysql and .php on web server



    H, everyone. I'm totally new to MySQL and php. I took few hours to figure out how to use the XAMPP to host a virtual web server. Faced so much problems and luckily, they are solved.

    But when I run the .php with my .sql import to a database in phpMyAdmin, the errors displayed in the picture just prompted. I tried to find solution online but it seems i cant find a suitable solution.

    Can anyone provide me some helps please?

    Thank you so much for spending time to read my problem. Much appreciate if solution can be given

    Just in case if you can't see the picture :
    Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\connection.php on line 7

    Warning: mysql_select_db(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\connection.php on line 12

    Warning: mysql_select_db(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\connection.php on line 12

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 12

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 12

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 13

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 13

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 14

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 14

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 15

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 15

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 16

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 16

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 17

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 17

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 18

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 18

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 19

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 19

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 20

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 20

    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:\xampp\htdocs\graphicalpass2\register.php on line 21

    Warning: mysql_query(): A link to the server could not be established in C:\xampp\htdocs\graphicalpass2\register.php on line 21

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 35

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 41

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 47

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 53

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 59

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 65

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 71

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 77

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 83

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\graphicalpass2\register.php on line 89

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Most of this is simply due to poor error handling in the script. It just happily assumes everything is good and keeps going.

    Your configurations are simply invalid. Provide a valid server, username, and password to the connection and go from there. There is no way to tell if its invalid beyond that, so you need to fix it up a part at a time.
    There sure seems to be a lot of repeating errors here. You're not opening and closing a connection within a loop are you?


  •  

    Posting Permissions

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