Q: SQL Query returning full results in MySQL, partial results coming back in PHP I have a query to return a player and his picks for a web application.  When I run it in MySQL, I get exactly what I expect: 7 players and their picks for the next 5 games.  However, when I move this into my PHP script, only three players picks are returned.  All 5 picks for the three people that are returned, the same three people every time, and not the "first three people" or the "last three people"
I have been banging my head on this for a couple hours...
MySQL Query:
SELECT Players.name, BowlTeams.team_name
FROM Players, BowlTeams, BowlGames, PlayerPicks
WHERE Players.ID = PlayerPicks.playerID AND PlayerPicks.win_team = BowlTeams.ID AND PlayerPicks.bowlID = BowlGames.ID AND 
(BowlGames.ID = 42 OR BowlGames.ID = 41 OR BowlGames.ID = 40 OR BowlGames.ID = 39 OR BowlGames.ID = 38)
ORDER BY Players.name, BowlGames.ID DESC

PHP Code:
try {
    $stmt = $conn->prepare('SELECT Players.name, BowlTeams.team_name
        FROM Players, BowlTeams, BowlGames, PlayerPicks
        WHERE Players.ID = PlayerPicks.playerID AND PlayerPicks.win_team = BowlTeams.ID AND PlayerPicks.bowlID = BowlGames.ID AND 
        (BowlGames.ID = :bowl_zero OR BowlGames.ID = :bowl_one OR BowlGames.ID = :bowl_two OR BowlGames.ID = :bowl_three OR BowlGames.ID = :bowl_four)
        ORDER BY Players.name, BowlGames.ID DESC');
    $stmt->bindParam(':bowl_zero', $bowl0, PDO::PARAM_INT);
    $stmt->bindParam(':bowl_one', $bowl1, PDO::PARAM_INT);
    $stmt->bindParam(':bowl_two', $bowl2, PDO::PARAM_INT);
    $stmt->bindParam(':bowl_three', $bowl3, PDO::PARAM_INT);
    $stmt->bindParam(':bowl_four', $bowl4, PDO::PARAM_INT);
    $stmt->execute();
    $emparray = array();
    while($row = $stmt->Fetch(PDO::FETCH_ASSOC)) {
        $emparray[] = $row;
    }
    $stmt->closeCursor();
    $stmt = null;
    echo json_encode($emparray);
} catch(PDOException $e) {
    echo "Oh no! Something f'd up! Error: " . $e->getMessage();
}       

I have verified repeatedly that the $bowl0-4 variables are properly populated (which would affect the BowlTeams.team_name returned, and those are fine).
I am just not getting all my players returned...
Thanks for any help, I am at my wits end.
K

A: As a starting point, this seems easier to read...
SELECT p.name
     , t.team_name
  FROM BowlGames g
  JOIN PlayerPicks k
    ON k.bowlID = g.ID 
  JOIN Players p
    ON p.ID = k.playerID 
  JOIN BowlTeams t
    ON t.ID = k.win_team 
 WHERE 
   AND g.ID IN(42,41,40,39,38)

...but without knowing your schema, it's hard to help further.

A: Figured it out.  I was working on a dev version and the database import had failed so I had an old version of the data....
Wow.  I think its time for a break when something as stupid as that happens...
Thanks all.
