我有5個sp_id,$ count也給了5個。但是當我通過mysqli_fetch_array檢查大小時,它給了我2號尺寸,只打印1並給出錯誤未定義偏移量:1進一步。獲取ids的值,我的意思是通過for循環打印id。mysqli_fetch_array錯誤未定義的偏移量:1
$selectId="Select sp_id from stitchedproduct";
$selectIdR = mysqli_query($connection,$selectId) or die(mysqli_error($connection));
$count = mysqli_num_rows($selectIdR);
$fetchedResult= mysqli_fetch_array($selectIdR);
for ($i=0;$i < $count; $i++) {
print $fetchedResult[$i];
}
嘗試的print_r($ fetchedResult); –
它沒有工作:( –