mySQL & PHP

Zack yellowdog-newbie@lists.terrasoftsolutions.com
Sat, 22 Jun 2002 17:45:57 -0400


I get an odd error message in when I attempt to use mysql_connect in a php script:

Fatal error: Call to undefined function: mysql_connect() in /home/sherlock/public_html/newsite/blah2.php on line 16

Here is my php code, which has worked on other servers before:

<?php
// Set the variables for the database access:
$Host = "localhost";
$User = "root";
$Password = "<not displayed";
$DBName = "sherlock";
$TableName = "property";

$Link = mysql_connect ($Host, $User, $Password) or die( mysql_error() );
$Query = "SELECT * from $TableName";
$Result = mysql_db_query ($DBName, $Query, $Link) or die( mysql_error() );
?>


To install Apache, mySQL, & PHP, I used "apt-get install apache mysql php" which downloaded and installed the appropriate packages.

I have enabled mysql support in both php.ini and httpd.conf.

All other PHP functions, including writing to a text file, seem to function just fine.

I have even reinstalled Apache, mySQL & PHP.

Anyone have any idea why mysql_connect AND mysql_pconnect would return as an undefined function? Its as if PHP has no idea what a mysql database is, even though it has built in support for it.

Any help is greatly appreciated, and I thank you in advance.

And yes, this is running on Yellow Dog Linux 2.2

Thanks,

-Z




__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/