Evanthes Posted November 21, 2006 Share Posted November 21, 2006 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 3here 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! Quote Link to comment https://forums.phpfreaks.com/topic/27969-php-mysql-connection-error/ Share on other sites More sharing options...
brown2005 Posted November 21, 2006 Share Posted November 21, 2006 session_start();$database_host = "";$database_username = "";$database_password = "";$database_name = "";$connection = mysql_connect($database_host, $database_username, $database_password) or die(mysql_error());$db = mysql_select_db($database_name, $connection); Quote Link to comment https://forums.phpfreaks.com/topic/27969-php-mysql-connection-error/#findComment-127942 Share on other sites More sharing options...
Evanthes Posted November 21, 2006 Author Share Posted November 21, 2006 thanks for the help, but im still getting the same error with that Quote Link to comment https://forums.phpfreaks.com/topic/27969-php-mysql-connection-error/#findComment-127947 Share on other sites More sharing options...
Evanthes Posted November 21, 2006 Author Share Posted November 21, 2006 im finding its some sort of problem with php, i guess the exe doesnt work well with mysql or something Quote Link to comment https://forums.phpfreaks.com/topic/27969-php-mysql-connection-error/#findComment-128007 Share on other sites More sharing options...
wildteen88 Posted November 21, 2006 Share Posted November 21, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/27969-php-mysql-connection-error/#findComment-128071 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.