没有结果显示Mysqli

时间:2014-04-16 17:20:03

标签: php mysql mysqli

我有这个查询,这是我做过的许多查询之一,所有其他查询效果很好,但这不会显示任何结果。我的数据库具有满足请求的结果。有人告诉我什么可能是错的?

<?php include_once "/phpmysqli/config.php" ?>
<?php 
$Week_ID = $teams->WeekID->CurrentValue;
$GKB = $teams->Keeper2->CurrentValue;
$stmt16 = mysqli_stmt_init($conn);
    if (mysqli_stmt_prepare($stmt16,"SELECT Total_pts FROM keeper_points WHERE PlayerID=? AND WeekNo=?"))
    {
      mysqli_stmt_bind_param($stmt16,"ss",$GKB,$Week_ID);
      mysqli_stmt_execute($stmt16);
      mysqli_stmt_bind_result($stmt16,$GKB_pts);
      mysqli_stmt_fetch($stmt16);
      echo $GKB_pts;
      mysqli_stmt_close($stmt16);
     }
?>

1 个答案:

答案 0 :(得分:0)

听起来像PlayerID和WeekNo列可能是整数。 如果是,则尝试传递参数:

mysqli_stmt_bind_param($stmt16,"ii",$GKB,$Week_ID);