0
我正在嘗試從數據庫中按順序提取一個id列。我已經寫了這段代碼,但沒有奏效。PHP注意:未定義偏移量1
$connection = mysqli_connect($servername,$username,$password,$dbname);
if(!$connection)
die("Database connection failed: " . mysqli_connect_error());
$query = "SELECT ID FROM channel ";
if($result = mysqli_query($connection,$query))
{
$count = mysqli_num_rows($result);// it will start from the first row and continue with others...
//fetch one and one row
while($row=mysqli_fetch_row($result))
{
for($i=0; $i<$count; $i++)
echo "<a>$row[$i]</a>";
}
//free result set
mysqli_free_result($result);
}
mysqli_close($connection);
所以,這個代碼給了我這個錯誤:
注意:未定義抵消:1在C:\ XAMPP \ htdocs中\ GT \在線fetch_channel.php 24
誰能幫助我關於那個 ?
嗨,u能請告訴你已經放在線24 –