Page 1 of 1
Mysql Problems
Posted: Wed Jun 01, 2005 6:35 pm
by cjermain
Im running my IIS on my windows XP machine and I have recently installed PHP and MySql. However when I attempt to open a database:
$db=mysql_connect("localhost", "root","**EDITED**");
I recive an error:
Fatal error: Call to undefined function mysql_connect()
When I looked further by using phpinfo() I am not able to find any mention of MySql. I have tried reinstalling MySql, and nothing has changed. Any idea of what my problem is??
Thanks!
-Colin J
Posted: Wed Jun 01, 2005 10:10 pm
by wyred
What version of PHP did you install?
If you downloaded version 5, note that the mysql libraries are no longer included. Here's the link.
http://www.php.net/manual/en/migration5.databases.php
There were some changes in PHP 5 regarding databases (MySQL and SQLite).
In PHP 5 the MySQL client libraries are not bundled, because of license problems and some others. For more information, read the FAQ entry.
There is also a new extension, MySQLi (Improved MySQL), which is designed to work with MySQL 4.1 and above.
Since PHP 5, the SQLite extension is built-in PHP. SQLite is an embeddable SQL database engine and is not a client library used to connect to a big database server (like MySQL or PostgreSQL). The SQLite library reads and writes directly to and from the database files on disk.
Posted: Thu Jun 02, 2005 1:59 pm
by cjermain
Yea, I have PHP Version 5.0.4. I will look into that problem.
Posted: Thu Jun 02, 2005 6:10 pm
by cjermain
I found the error as addressed by MySql
Site
http://dev.mysql.com/doc/mysql/en/php-problems.html
"Error: "Fatal error: Call to unsupported or undefined function mysql_connect() in .." This means that your PHP version isn't compiled with MySQL support. You can either compile a dynamic MySQL module and load it into PHP or recompile PHP with built-in MySQL support. This is described in detail in the PHP manual. "
How do I "recompile PHP with built-in MySQL support"?
Thanks!
-Colin J
Posted: Fri Jun 03, 2005 2:48 am
by wyred
If you don't know anything about compiling, I would suggest you downgrade to PHP4, which has support for MySQL.
You can check out this link on how to compile it on a Windows system. I only took a glance and I think it does not teach you how to compile it with MySQL support.
http://www.php.net/manual/en/install.wi ... ilding.php
Posted: Fri Jun 03, 2005 2:57 am
by timvw
All you need to do is uncomment
;extension=php_mysql.dll
Posted: Fri Jun 03, 2005 3:39 pm
by cjermain
hey that works!!!!!!!!!!!!!
thanks!!!
-Colin J
Posted: Fri Jun 03, 2005 10:25 pm
by Mastermind
That also my problem.
Posted: Sun Jun 05, 2005 9:05 pm
by wyred
timvw wrote:All you need to do is uncomment
;extension=php_mysql.dll
Hi Tim, does this mean PHP5 comes with MySQL support just that it's disabled by default?
I haven't tried PHP5, still sticking with 4.
Posted: Sun Jun 05, 2005 9:16 pm
by John Cartwright
does this mean PHP5 comes with MySQL support just that it's disabled by default?
correct.
Posted: Sun Jun 05, 2005 11:58 pm
by wyred
:o
Alright, thanks. :)