Problem connecting to mysql server using php

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jlryan
Forum Newbie
Posts: 2
Joined: Mon Jan 17, 2005 11:20 am

Problem connecting to mysql server using php

Post by jlryan »

Whenever i try to connect to mysql server, i get this:
Fatal error: Call to undefined function mysql_connect() in ........ on Line ....

What's wrong?
i've mysql and apache installed on an external drive and both of them are working individually. Their host is localhost and the port for apache is 81 and for mysql is 3306.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

php5? you have to enable mysql support.

php4? you may need to edit your php.ini and restart the server.
jlryan
Forum Newbie
Posts: 2
Joined: Mon Jan 17, 2005 11:20 am

Post by jlryan »

how to enable mysql support?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

ref.mysql.php wrote:In PHP 5, MySQL is no longer enabled by default, nor is the MySQL library bundled with PHP. ...

Note: Windows users will need to enable php_mysql.dll inside of php.ini and either copy libmysql.dll into the Windows system directory, or make it available to the PATH.
Additional information can be found on install.windows.php and ref.mysqli.php
Post Reply