課程
/后端開發(fā)
/PHP
/Duang~MySQLi擴(kuò)展庫來襲
為什么我的 rows顯示未定義了
2016-08-22
源自:Duang~MySQLi擴(kuò)展庫來襲 2-6
正在回答
你的代碼,我試過了,沒問題呀,IDE顯示的是第幾行有問題?
$sql ="SELECT id,username,age FROM tb1";
$mysqli_result=$mysqli->query($sql);
if($mysqli_result && $mysqli_result-> num_rows>0){
while ($row=$mysqli_result->fetch_assoc()){
$rows[]=$row;
}?
}
print_r($rows);
?>
舉報(bào)
本教程從面向?qū)ο蠛兔嫦蜻^程兩個(gè)方面為你開啟MySQLi學(xué)習(xí)之旅
1 回答$rows[] = $row;什么意思?
2 回答<?php foreach($rows as $row):?> 報(bào)錯(cuò) $rows 無效參數(shù)是什么情況呢?
1 回答foreach($rows as $row)是起什么作用
1 回答為什么運(yùn)行后提示“Notice: Undefined variable: rows in ”?
3 回答求教啊老師
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-11-22
你的代碼,我試過了,沒問題呀,IDE顯示的是第幾行有問題?
2016-08-22
$sql ="SELECT id,username,age FROM tb1";
$mysqli_result=$mysqli->query($sql);
if($mysqli_result && $mysqli_result-> num_rows>0){
while ($row=$mysqli_result->fetch_assoc()){
$rows[]=$row;
}?
}
print_r($rows);
?>