Re: php mysql connection help..
Same answer -- if you want to use MySQL with PHP 5, you must enable one of the two MySQL extensions -- ext/mysql or ext/mysqli.
To enable the mysql extension:
1. Copy libmysql.dll to a directory in your system path.
2. Make sure there's a line reading: extension = php_mysql.dll in you php.ini file, and that there's no ; at the beginning of the line.
To enable the mysqli extension:
1. Copy libmysql.dll to a directory in your system path.
2. Make sure there's a line reading: extension = php_mysqli.dll in you php.ini file, and that there's no ; at the beginning of the line.
On my test machine running Windows 2000 Server with Apache 1.3.37, PHP 5.04 (as mod_php5), and MySQL 5.0.4-max:
* PHP installed in C:\php - php_mysql.dll in C:\php\ext
* C:\php added to system path - libmysql.dll in C:\php - this is the version of libmysql.dll that comes with PHP 5.0.4, not the version that comes with MySQL.
* php.ini file in C:\WINNT with the uncommented lines:
extension = php_mysql.dll
and
extension = php_mysqli.dll
(I have both extensions - mysql and mysqli - enabled on that system.)
Jon Stephens
MySQL Documentation Team @ Oracle
MySQL Dev Zone
MySQL Server Documentation
Oracle