Jump to content

php -> mysql connection error


Evanthes

Recommended Posts

Hey guys ive been developing a program on my local machiene thats works great, however now im moving it to our webserver and am having some problems. I've duplicated everything on the server with the exception of the port that mysql runs on. and now i am getting the following error:
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\cp\opendb.php on line 3

here is my db connection code
[code]
//opendb.php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');
mysql_select_db($dbname);
[/code]

i guess I'm just wondering why the php in the statement isnt being processed and its giving me the mysql error instead of "error connecting to mysql" like it should say in the code.
the server is a 2k server running IIS, if that might have anything to do with it. thanks for your help!
Link to comment
https://forums.phpfreaks.com/topic/27969-php-mysql-connection-error/
Share on other sites

No that is not the problem at all. Its because your PHP set-up doesn't have the MySQL extension enabled. Please read this [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]This FAQ[/url] to enable the MySQL extension.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.