Is this because function mysqli_connect() is a PHP5 function? My server runs PHP4.x.Fatal error: Call to undefined function: mysqli_connect() in /a/pollux.jour.city.ac.uk/export/JOUR-1/students/m2005/abbf950/web/ecomm/functions_main.inc on line 10
If so is there a work around? The example is perfect for my needs and would be gutted if this 'glitch' prevented me from using it.
Here's the code from the include:
Code: Select all
<?php
/* Function: Connect_to_db
* Desc: Connects to a MySQL database. The name of
* a file containing the database variables
* is passed to the function.
*/
function Connect_to_db($filename)
{
include($filename);
$cxn = mysqli_connect($host, $user,$passwd)
or die ("Couldn't connect to server.");
$db = mysqli_select_db($cxn,$database)
or die ("Couldn't select database.");
return $cxn;
}
?>Sophie xx.
Note: I am using a University server and so cannot make changes to the PHP running on iit.