connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $rand = mt_rand(1, 6); $ads = "SELECT * FROM `ads` WHERE `id` = $rand"; if(!$result = $db->query($ads)){ die('There was an error running the query [' . $db->error . ']'); } $row = $result->fetch_assoc(); if($row){ return 'ad for '.$row['cname'].''; } } ?> \n"; echo " \n"; echo " \n"; echo " \n"; echo " UnPS-GAMA Image Host - Now Showing: ".$_GET['img']."\n"; }else{ echo "UnPS-GAMA Image Host\n"; } ?>