Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //include('config.php');
- class player
- {
- private $mysql;
- private $db;
- public function __construct($_mysql, $_db)
- {
- $this->mysql = $_mysql;
- $this->db = $_db;
- }
- public function getPlayerInfo()
- {
- $this->mysql->query("use " . $this->db);
- $stmt = $this->mysql->prepare("SELECT p.name, p.age, p.height, p.nationality, p.position, pa.*
- FROM players AS p
- INNER JOIN playerattributes pa
- ON p.id = pa.player_id");
- if(!$stmt->execute())
- return false;
- $result = $stmt->get_result();
- $data = mysqli_fetch_array($result);
- return $data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement