Advertisement
Guest User

function get_team

a guest
Mar 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. function get_team($team_id) {
  2.  
  3.         global $db;
  4.  
  5.         $query = "SELECT * FROM teams
  6.                   LEFT JOIN countries ON teams.fk_country_id = countries.id
  7.                   LEFT JOIN games ON teams.fk_game_id = games.game_id
  8.                   WHERE team_id = $team_id";
  9.  
  10.         if ($result = $db->query($query)) {
  11.             if ($result->num_rows) {
  12.  
  13.                $post = $result->fetch_object();
  14.  
  15.             }
  16.             $result->free(); // Frigør hukommlsen
  17.         }
  18.  
  19.         return $post;
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement