invalid mysql request

im totally new to php and have only being learning for around a week.
ive been playing aroound with this script, trying to see if i can iron out the bugs but am having some problems. i am getting the following error,

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /content/StartupHostPlus/v/i/virus-mafia.com/web/setup.php on line 63

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /content/StartupHostPlus/v/i/virus-mafia.com/web/setup.php on line 69

the code i am using is,

<?

$time=time();

$site[location] = 'http://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] = '***';      //DATABASE HOST "mysql4.namesco.net"
$db[user] = '***';    //DATABASE USERNAME
$db[pass] = '***';        //DATABASE PASSWORD
$db[name] = '***';   //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] = '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];
?>

I am asssuming i have missed a curly bracket or something somwhere along the lines but arent sure where? any ideaz?

What query are you running? Use echo statements to verify this. I’m thinking your variables aren’t parsed in the way you expect them to, because they’re arrays.

Sponsor our Newsletter | Privacy Policy | Terms of Service