Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help wanted with a php script

Status
Not open for further replies.

gjm68

MIS
Sep 4, 2005
9
GB
I have this php script.

<?php
require ($_SERVER["DOCUMENT_ROOT"] . "/config/db_config.php");

$connection = mysql_connect($db_host, $db_user, $db_password) or die("Error Connecting");

echo "Connection Sucessful";
?>

When I run this script, I get this error message:

Fatal error: Call to undefined function mysql_connect() in F:\web site\webroot\temp_con.php on line 4

I am not sure what is wrong with the mysql_connect() function.

I am running mysql server 4.1 and php 5.

Could this be something to do with the php.ini file? I don't have one but I have two files in my php directory

php.ini-dist
php.ini-recomended

I am new to php. Do I have to rename one of these files? Do I have to put it in another directory?

Any help will be gratefully accepted.

thanks
 
What do you have in db-config.php?

It seems that you are using Windows.

Enable this line in php.ini:

;extension=php_mysql.dll

Becomes:

extension=php_mysql.dll

And copy php_mysql.dll from ext folder of your PHP folder to the ext folder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top