Re: invalid function: mysql_connect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Catapult Webmaster wrote:


i would just like to ask if i have missed anything in the installation (e.g. configuration for MySQL connectivity) because the ff. piece of code always returns "Fatal error: Call to undefined function mysql_connect() in F:\xitami\catapult\index.php on line 13."
This is the part of my code that's causing the error (the whole file is saved as test.php):
<?php
$user = "";
$pswd = "";
$link = mysql_connect("localhost", $user, $pswd);
if (! $link)
die("Could not connect to MySQL.");
print "Successfully connected to the server.<br>";
mysql_close($link);
?>
Quick info on my current environment:
OS: Win XP SP1, MySQL ver 4.0.20d, PHP 5.0.1, Xitami 2.5b4
However, I would like to inform you that the ff. works (saved as php_set.php):
<?php
phpinfo();
?>
... as well as connecting to MySQL through the command prompt (i am able to create/update/select databases)...



Does the phpinfo() output show that MySQL support is activated? If not, perhaps you need to uncomment the line


;extension=php_mysql.dll

(remove the ;) in your php.ini file. You may need to restart your web server after changing the line.

Janet

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux