0
我的查詢無法取回。它在我的SQL控制檯中工作得很好,所以我不知所措。這是代碼。mySQLi準備語句:取()失敗
$q_st = "SELECT tryouts.playerFName,tryouts.playerLName,tryouts.mainEmail,
tryouts.secondEmail, players.number FROM tryouts LEFT JOIN players ON
players.userID=tryouts.userID WHERE players.team = ?
ORDER BY tryouts.playerLName";
$stmt = $GLOBALS['m']->prepare($q_st);
$stmt->bind_param("s",$GLOBALS['c_team']);
$stmt->execute();
$stmt->bind_result($pfn,$pln,$em,$em2,$num);
if($stmt->fetch()==false)
{
echo($GLOBALS['m']->error . $GLOBALS['m']->sqlstate ." Haha It doesn't work and YOU don't know why!!!");
}
else
{
while($stmt->fetch()) {
static $count3;
echo ($pfn . " " . $pln . " " . $num . "<input type=\"checkbox\" class=\"player\" value=\"" . $em ."\" id=\"player ". ++$count3 . "\"><br />");
}
}
結果是「00000哈哈它不起作用,你不知道爲什麼!!!」
我測試了所有其他的stmt參數,它們都通過了成功。 任何想法?
mysqli_stmt_num_rows返回0.受影響的行返回-1。沒有錯誤或錯誤。還有什麼想法? – narotosensei
我與它搞亂了一下,不管是什麼原因,它現在的工作。去搞清楚。感謝您的有用建議! – narotosensei