Hey all,
I recently created a very basic cms and had everything running perfectly on my web server at home, however when I uploaded the site to my webhost it won't connect to my database!
Here is the code it has a problem with:
function db_connect()
{
$handle = new mysqli('localhost', 'content', 'password', 'content');
if (!$handle)
{
return false;
}
return $handle;
}
I now that mysqli needs php5 (which my webhost has 4.4.1) but when I try every other combination I can think of (including new mysql, new mysql_connect, etc) I still get the following error:
Fatal error: Cannot instantiate non-existent class: mysql_connect in /home/www/xxxxxxxxx.com/db_fns.php on line 5
what is the correct code to connect to my mysql database?