problem mysql_connect with php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • utsavi
    New Member
    • Mar 2010
    • 1

    problem mysql_connect with php

    sir
    i wrote the code to connect php with mysql
    but it create error
    CODE
    Code:
    <?php
    $con = @mysql_pconnection("localhost","utsavi",****);
    if ($con)
    { 
    echo("connect");
    }
    ?>
    ERROR
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localho st' (using password: YES) in E:\vnr\utsavi1\ xampp\htdocs\cn c.php on line 6
    Error connecting to mysql

    PLEASE
    send me right information & code
    Last edited by Dormilich; Mar 24 '10, 08:51 AM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    mysql_pconnecti on() is no native PHP function (that would be mysql_pconnect( )), however, you connect through mysql_connect() , reason for that: your function fails, but by calling mysql_select_db (), it tries to open a connection with mysql_connect() using the default values.

    you manage to log in as "root", not as "utsavi". obviously the two passwords don’t match.

    no neet to use @ to suppress errors (that usually backfires to you in some way)

    Comment

    Working...