我使用此sql來獲取語言和v =語言級別。我檢查了phpmyadmin中的sql,它是正確的。如何在二維數組中存儲值
$qry3 = "Select Language, Level
from languages l, particulars_language pl
where pl.Particulars_ID = ". $ID ."
and l.Language_ID = pl.Language_ID;";
$result2 = mysqli_query($connect, $qry3);
下面我想從數據庫中添加他們的語言和語言級別的數據。你怎麼做呢?
while($row1 = mysqli_fetch_assoc($result2))
{
$Language = $row1['Language'];
$Level = $row1['Level'];
$languagelevel = array
(
array($Language,$Level)
);
}
?>
什麼是你想要的輸出? 'array('en'=> 9,'cn'=> 3,...)'? 'array(array('en',9),array('cn',3))'?只是爲了給出一些可能的輸出例子... – maxhb