public function lookForWinner($current_game, $win_cost) {
$sql = "SELECT * FROM game" . $current_game . " WHERE from <= ? AND to >= ?";
$query = $this->db->prepare($sql);
$query->execute(array($win_cost, $win_cost));
if ($query->rowCount()) {
$lookForWinner = $query->fetch(PDO::FETCH_ASSOC);
return $lookForWinner;
}
return false;
}
$lookforwinner = $objGame->lookForWinner($current_game, $wincost);
I am tryin that code but always return false. I checked my parameters : $current_game = "1"
and $wincost = 0.19276355021
wincost is float type. my from and to entities' type are text in mysql. But i also tried with float type and result is same.