Giarc86
Expert Member
- Joined
- May 28, 2008
- Messages
- 1,243
- Reaction score
- 4
I signed up for the R19 a month UNIX uncapped hosting from MWEB and for some reason I can't connect to the database.
I have used the details they gave me to connect but it still wont.
I never had a problem on my previous host. I just changed the config file to reflect the new details when I switched to MWEB.
A Wordpress install wont work either.
Does anyone know why it wont connect? Is it possible MWEB messed something up?
I have used the details they gave me to connect but it still wont.
I never had a problem on my previous host. I just changed the config file to reflect the new details when I switched to MWEB.
A Wordpress install wont work either.
Does anyone know why it wont connect? Is it possible MWEB messed something up?
PHP:
<?php
$servername='db1.swh.mweb.net';
$dbusername='myusername';
$dbpassword='mypass';
$dbname='dbname';
connecttodb($servername,$dbname,$dbusername,$dbpassword);
function connecttodb($servername,$dbname,$dbuser,$dbpassword)
{
global $link;
$link=mysql_connect ("$servername","$dbuser","$dbpassword");
if(!$link){die("Could not connect to MySQL");}
mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());
}
?>