Trying to connect to database

I get the following error when trying to connect to the mysql database. The sql server resides at my website host:
Fatal error: Call to undefined function mysql_pconnect() in C:

hello can we look at the mysql_pconnect() function please

mysql_pconnect() is a standard function in the mysql library

Your web host does not have the mysql library for PHP installed.

Indeed, mysql doesn’t ship with php5+
You should be able to use mysqli or [URL=“http://nz.php.net/manual/en/book.pdo.php”]PDO though.

Also you don’t need persistent connections.

Thanks I will contact my host

I normally connecting to MySQL database in PHP by following the code in Chapter 4 of the “Build Your Own Database Driven Website” (a Sitepoint book).

It goes something like …


$dbcnx = @mysql_connect('localhost', 'username', 'password');
if ( !$dbcnx) {
  echo 'Unable to connect';
  exit();
}

mysql_select_db('dbname', $dbcnx);

Thanks my problem is sorted. My host installed a new version of PHP and put a coma at the wrong place