connect to mysql database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dipal
    New Member
    • Dec 2006
    • 5

    #1

    connect to mysql database

    i want to connect the mysql database but i got following error

    Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Dipal\PHP\fi rst.php on line 9
  • mainul
    New Member
    • Sep 2006
    • 51

    #2
    send me your whole code please

    Comment

    • dipal
      New Member
      • Dec 2006
      • 5

      #3
      I m totally new to php i just started to check the connectivity option of php with mysql.The code is given below

      <?php
      $db = mysql_connect(" localhost", "root","dipal") ;
      mysql_select_db ("employee",$db );
      $result = mysql_query("SE LECT * FROM emp",$db);
      printf("First Name: %s<br>\n", mysql_result($r esult,0,"name") );
      ?>

      <?php
      $db =mysql_connect( "localhost" , "root","dipal") ;
      mysql_select_db ("employee") ;
      $result = mysql_query("SE LECT * FROM emp");
      $numrows = mysql_num_rows( $result);
      print "There are $numrows people in usertable\n";
      ?>




      Originally posted by mainul
      send me your whole code please

      Comment

      Working...