I have following tables
myListTable
playerId listId type
50 10 0
51 10 0
players
id x xx etc
50 x xx etc
51 x xx etc
I want to run a query where i provide listId and type and it will get the lists of all players related to that listId and type
try {
$conn = $this->GetDBConnection();
$type = 0; // 0 REQUEST BY PLAYERS
$statement = $conn->prepare('SELECT p.* FROM myListTable c, players p WHERE (c.listId = :listId ) AND (c.type = :type) AND ( p.id = c.playerId) ');
$statement->bindParam(':listId', $listId, PDO::PARAM_INT);
$statement->bindParam(':type', $type, PDO::PARAM_INT);
$statement->execute();
if(!($row = $statement->fetchAll(PDO::FETCH_ASSOC))) {
return false;
}
$conn = null;
} catch(PDOException $e) {
throw $e;
}
This is just returning me false. What do i have to do to fix this query?