Hi !

I installed mysql server on my winxp platform. To make sure i'm connected to the mysql server i wrote the following command in the dos window:

program files\mysql\mysql server 4.1\bin\mysqladmin -pmypass -uroot ping

and recieved the following notification:

mysql is alive

which means: i'm connected to mysql.
I write the following code using php:

<?php

$myconnection=mysql_connect("root","mypass");

?>

and i recieve the following error mesdage:

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\cgi-bin\mysql.php on line 2

could any one explain me why i cant activate mysql commands using php ?
Thanks !

    You're using mysql 4.1?
    What version of PHP are you using, and have you enabled mysql support?
    Have you considered the improved mysql extension?

      i'm using "mysql-essential-4.1.12a-win32.msi'.
      php version is: 5.0.4.
      how do i enable "mysql support" ?
      what is "improved mysql extension" ?

        to enable mysql for php you have to edit php.ini so the extension_dir is pointing to the php_*.dll files.
        and then uncomment the line
        ;extension=php_mysql.dll
        to be
        extension=php_mysql.dll

        then restart the webserver and it should be ok

          But.. if he's using MySQL 4.1, then the old MySQL functions won't work (especially mysql_connect), will they? Due to the new password algorithm and such?

            right if its 4.1 or higher he needs to use php5 mysqli

              OR... if you enable 'old_password' support in MySQL 4.1, can you still use the old MySQL functions in PHP?

                Write a Reply...