KyleMassacre

bfhruxhs

Jul 14th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. $timehour = 3600;
  2. /*$time = unix_timestamp();*/
  3. $busts= ("SELECT COUNT(b.bustid), b.bid,b.time,u.username,u.display_pic, u.userid FROM `busts` b LEFT JOIN `users` u ON b.bid=u.userid WHERE b.time > " .time(). " - " .$timehour. " ORDER BY b.bid limit 0,1 ") or die($db->error());
  4.     $result = mysql_query($busts) or die(mysql_error());
  5. //IF THERE ARE ENTRIES IN THE DB AND THIS SHOWS REMOVE THE ! FROM THE IF
  6.      if (!$result->EOF) {
  7. echo"Buster of the Hour: None";
  8.  
  9. }else{
  10. // Print out result
  11. //IF THERE ARE NO ENTRIES IN THE DB AND ITS TRYING TO SHOW THIS ADD A ! TO THE WHILE STATEMENT
  12. while($result->EOF) {
  13. $row = mysql_fetch_array($result)
  14. $user=$db->query("SELECT username FROM `users` WHERE `userid` = ".$row['bid']."");
  15.     echo "Buster of the Hour: <a href='viewuser.php?u={$row['bid']}'> {$row['username']} ID[". $row['bid'] ."] </a> <img src='{$row['display_pic']}' width='100px' height='100px' />";
  16.     };
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment