Today I have installed MySQL 5.0.0-alpha-nt on Win 2000. Server is working fine. I was trying to implement mysqli. PHP is not interecting with MySQL properly.

Following Code:

<?php
$link = mysql_connect('localhost', 'root', 'my password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

Generates error ...

Fatal error: Call to undefined function mysql_connect() in C:\Xitami\paddyhtdocs\test.php on line 2

Please help. How to get rid of it?
I have turned on php_mysql.dll as well.
a
What should I do now

    its extension_dir fine? this is where php_mysql.dll will exist.

    watch out your configuration again

      Yeah Jayant, I checked that is fine. When I tried to run phpmyadmin it has generated following message

      #1250 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

        i suspect this is the mySQL password hashing problem. the mySQL client library that's bundled with PHP uses 16char passwords. starting with mySQL 4.1 they now use 41char passwords. if you try to connect using the old client lib then you will see that error "Client does not support authentication protocol requested by server". you basically have 2 choices. if you want to continue using the regular mySQL functions you need to run a query like this:

        UPDATE mysql.user SET Password = OLD_PASSWORD('xxx') WHERE Host = 'xxx' AND User = 'xxx';
        

        substitute x's as necessary. the other alternative is to use the new mySQLi functions (which use the newer cleint library).

          Now MySQLi is working. I added an extension

          php_mysqli.dll in my php.ini. This extension is not there in ini file that comes with php 5 installation.

          myPHPADMIN is also working with mysqli.

          Cheers !!!!

            15 days later

            is there a way to get the my_sqli functions working in php 4.3.9?

            i checked the dll directories and it is not present.

            anyone have any ideas?

              Write a Reply...