Hi im having problems with my MySQL database connection, im a n00b at PHP (only just started) and so am having probs with it and would appreciate any info on wtf im doing wrong, ive gone through but cant notice anything! PLZ HELP!
the code is;
<?
//Good ol' time
$time=time();
//////PRETTY SIMPLE, MAKE SURE URL LOCATIONS END WITH "/"
$site[location] = 'http://www.virus-mafia.com/'; ///SITE LOCATION
$site[img] = 'http://virus-mafia.com/images/'; ///SITE IMAGES
//////UPLOAD SETTINGS
$dir="../images/icons/$tru/";
$arr_allow_ex=array("gif","jpg","png");
$maxupload[sup] = '5000'; //supporter upload in bytes
$maxupload[nor] = '2500'; //normal upload in bytes
//////DATABASE CONFIG, AND CONNECTION
$db[host] = 'mysql4.namesco.net'; //DATABASE HOST "mysql4.namesco.net"
$db[user] = 'virusmafiaco'; //DATABASE USERNAME
$db[pass] = 'slimshady'; //DATABASE PASSWORD
$db[name] = 'virusmafiaco'; //DATABASE NAME
$connect = mysql_connect($db[host],$db[user], $db[pass]);
mysql_select_db("$db[name]") or die ("Could not connect to database");
//////DATABASE TABLES
$tab[user] = 'users';
$tab
= 'html';
$tab[news] = 'news';
$tab[game] = 'games';
$tab[stat] = 'stats';
$tab[censor] = 'censors';
$tab[banned] = 'bans';
$tab[paypal] = 'paypal';
/////GAME DATABASE TABLES
$tab[board] = "board";
$tab[clist] = "contacts";
$tab[city] = "city";
$tab[crew] = "crew";
$tab[invite] = "invites";
$tab[mail] = "mailbox";
$tab[pimp] = "pimp";
$tab[revenge] = "revenges";
$tab[cron] = "cronjobs";
if(($tru) && (!mysql_fetch_row(mysql_query("SELECT round FROM $tab[game] WHERE round='$tru' AND starts<$time AND ends>$time;"))))
{ header("Location: $site[location]play.php"); }
if($tru){
$tab[board] = "r".$tru."_board";
$tab[clist] = "r".$tru."_contacts";
$tab[city] = "r".$tru."_city";
$tab[crew] = "r".$tru."_crew";
$tab[invite] = "r".$tru."_invites";
$tab[mail] = "r".$tru."_mailbox";
$tab[pimp] = "r".$tru."_$tab[pimp]";
$tab[revenge] = "r".$tru."_revenges";
$tab[cron] = "r".$tru."_cronjobs";
}
//////CENSORS
$getcensors = mysql_query("SELECT censor FROM $tab[censor];");
$censorwords = array();
while($censor=mysql_fetch_array($getcensors)) {
array_push($censorwords, $censor[0]);
}
//GRAB THEY MASTER AND GAME ID
if($tru){ $id = mysql_fetch_array(mysql_query("SELECT id FROM $tab[pimp] WHERE code='$trupimpn';")); }
else{ $id = mysql_fetch_array(mysql_query("SELECT id FROM $tab[user] WHERE code='$trupimp';")); }
$id=$id[0];
?>