Jump to content

mysql_connect() error in PHP script in Kubuntu


peterv6

Recommended Posts

I'm having a problem with a PHP script that's trying to connect to a MySQL database.  This script works perfectly in OS X, but when I run it in Kubuntu, I get the following error:

Fatal error: Call to undefined function mysql_connect() in /var/www/Sites/LP2/dbc.php on line 2.  The script is as follows:

 

<?php
$mysql = mysql_connect('127.0.0.1', 'peterv', 'password');
if (mysql_connect_errno()) {
   printf("Connect failed: %s\n", mysql_connect_errno());
   exit();
} else {
   printf("Host information: %s\n", mysql_get_host_information($mysql));
}
?>

 

I'm assuming it has something to do with my PHP installation, but I'm a relative newbie to this.  Any help or suggestions will be GREATLY appreciated.

PETERV

MySQL version - 5.1.41-3ubuntu12.10 (Ubuntu)

 

What do you mean by "child" board?  I did a search for mysql_connect() prior to posting, and found nothing relevant.  I'd much rather follow a successful prior post than to post something redundantly.

fenway,

Thanks for the link, but it refers to the resolution of the problems on a Windows system, and I'm running Kubuntu Linux.  I'll see if I can find the correct directory for that, and post it here if I can find it.  (If you know which it is, please post it.)  Thanks again.

Peter V.

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.