Fscore/objects/Players_Games_Clashes.php
/* pesquisar filtro e jogo especifico estatic de players*/
pesquisar filtro e jogo especifico estatic de players
pesquisar filtro e jogo especifico estatic de players
function searchByGamesinGamePlayer($keywords_game,$keywords_type) {
        $query = "SELECT                    	
                        play_game.id,play_game.idgame_clashe,play_game.idcompetition,play_game.idteam_home,
                        play_game.idteam_away, play_game.idplayer,play_game.type_game_clashe,play_game.initial_formation,
                        play_game.alternate_formation, play_game.punished, play_game.accumulation,play_game.expulsion,
                        play_game.injured,play_game.doubt,
                        play.nickname as nickname_player, play.photo_player,
                        counP.name as name_country,counP.flag_country
                    FROM
                        " . $this->table_name ." as play_game
                    LEFT JOIN players as play
                        ON play.id = play_game.idplayer
                    LEFT JOIN countries as counP
                        ON counP.id = play.idcountry
                    WHERE
                        play_game.idgame_clashe LIKE ? AND play_game.type_game_clashe LIKE ?
                    ORDER BY play_game.idplayer DESC";
        $stmt = $this->conn->prepare($query);
        $search_game = '%'.filter_var($keywords_game,FILTER_SANITIZE_NUMBER_INT).'%';
        $search_type = '%'.filter_var($keywords_type,FILTER_SANITIZE_STRING).'%';
        $stmt->bindValue(1, $search_game);
        $stmt->bindValue(2, $search_type);
        $stmt->execute();
        return $stmt;
    }
function searchByGamesinGamePlayer ( $ keywords_game , $ keywords_type ) { $ query = " SELECT                    	
                        play_game.id,play_game.idgame_clashe,play_game.idcompetition,play_game.idteam_home,
                        play_game.idteam_away, play_game.idplayer,play_game.type_game_clashe,play_game.initial_formation,
                        play_game.alternate_formation, play_game.punished, play_game.accumulation,play_game.expulsion,
                        play_game.injured,play_game.doubt,
                        play.nickname as nickname_player, play.photo_player,
                        counP.name as name_country,counP.flag_country


                    FROM
                         " . $ this -> table_name . "  as play_game
                    LEFT JOIN players as play
                        ON play.id = play_game.idplayer
                    LEFT JOIN countries as counP
                        ON counP.id = play.idcountry
                    WHERE
                        play_game.idgame_clashe LIKE ? AND play_game.type_game_clashe LIKE ?
                    ORDER BY play_game.idplayer DESC " ; $ stmt = $ this -> conn -> prepare ( $ query ) ; $ search_game = '%' . filter_var ( $ keywords_game , FILTER_SANITIZE_NUMBER_INT ) . '%' ; $ search_type = '%' . filter_var ( $ keywords_type , FILTER_SANITIZE_STRING ) . '%' ; $ stmt -> bindValue ( 1 , $ search_game ) ; $ stmt -> bindValue ( 2 , $ search_type ) ; $ stmt -> execute ( ) ; return $ stmt ; }
pesquisar filtro e jogo especifico estatic de players
pesquisar filtro e jogo especifico estatic de players
// Query SQL // Preparar query // Filtrar palavras de pesquisa // Atribuir valores  // Executar query