Jump to content

my select statement is not returning what i was hoping


blue-genie

Recommended Posts

$sql = "SELECT * from (gamedetails left join gamestats on gamedetails.gameID) left join gameprizes on gameprizes.gamePrizeID = gamedetails.gameID left join playerdetails on gamestats.statsPlayerID = playerdetails.playerID WHERE date(startDate) <= date('".$compDateStr."')  and date(endDate) >= date('".$compDateStr."')  and gameIsActive = 1 ORDER BY SCORE desc LIMIT 11";

 

compDateStr is some dodgy thing i'm doing as follows

 

$today = getdate();

$y = $today[year];

$m = $today[mon];

$d = $today[mday];

$compDateStr = "".$y."-".$m."-".$d.""; 

 

so if i don't have an ID to retrieve data by i want to get what falls between a certain time frame, but I'm getting more stuff then I'm supposed to.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.