-1
這是我的代碼。我認爲問題出在$retrieve["'choice'.'$i'"];
這是什麼格式?從數據庫中獲取數據不起作用
$i = '1';
do {
$choice[$i] = $retrieve["'choice'.'$i'"];
$i++;
}
while ($i <= $numberofchoices);
echo $choice['1']; //not working!!
爲了得到一個想法,爲什麼,'回聲「‘選擇’‘$ I’。」'刪除那些外雙引號和周圍的變種引號。 '$ retrieve ['choice'。 $ i]'或插入雙引號'$ retrieve [「choice choice $ i」]' – 2013-02-23 01:05:10
'var_dump($ choice)'在while循環之前查看其中的內容。 – 2013-02-23 01:05:41
謝謝你們。 $ retrieve ['choice'。 $ i]或插入雙引號$ retrieve [「choice $ i」]工作。信貸給Michael Berkowski。我回應「'選擇'。'$ i'」;我以前有過什麼,可以看到它爲什麼沒有工作。 – MFA 2013-02-23 01:15:31