Forum Moderators: coopster
i am in my early days on intergrating MY Sql with PHP.
My windows 2000 server has bought PHP and MYsql installed.
When i attempt to connect to the mysql server using the forllowing PHP code
the below error message appears.
"Fatal error: Call to undefined function mysql_connect() in E:\Web_Server\php\con_mysql.php on line 2"
my php code is as follows.
[php]
<?php
$link = mysql_connect('MYSERVER', 'admin', '123456');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
[/php]
What could be the problem?
PHP Version 5.0.4
System Windows NT MYSERVER 5.0 build 2195
Build Date Mar 31 2005 02:44:34
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
Server API CGI/FastCGI
Virtual Directory Support enabled
Configuration File (php.ini) Path E:\WINNT\php.ini
PHP API 20031224
PHP Extension 20041030
Zend Extension 220040412
Debug Build no
Thread Safety enabled
IPv6 Support enabled
Registered PHP Streams php, file, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp
This is the my.ini file in winmysqladmin.
#This File was made using the WinMySQLAdmin 1.4 Tool
#4/14/2006 8:54:39 PM
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=C:/mysql
#bind-address=128.10.0.1
datadir=C:/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
user=admin
password=123456