我无法从单行获取密钥和值...
这是我的代码:
$tab_titres_fr=array();
$sql="SELECT * FROM recettes WHERE recetteid = '$id' ";
$request = mysqli_query($con,$sql);
$row = mysqli_fetch_assoc($request);
$tab_titres_fr[]=json_encode($row);
foreach($tab_titres_fr as $key => $value) {
echo $keys." / ".$value."<br>" ;
}
答案 0 :(得分:0)
$request = mysqli_query($db,$sql);
while($row = mysqli_fetch_assoc($request)){
$tab_titres_fr[]=json_encode($row);
}
foreach($tab_titres_fr as $key => $value) {
echo $key." / ".$value."<br>" ;
}