我有一个成功连接到MySQL数据库,并包含两个mysqli的查询的PHP脚本。第一个查询按预期运行。第二个查询将只能随声附和:我想我需要的东西free()
,但我不知道什么,我试图释放的第一个结果。PHP:循环错误的mysqli阵列
我相信这是我的一个简单的错误。我感谢您的帮助!
pffages:
aid | aTitle | aActive | aVersion
---------------------------------
3 | 16-17 | 1 | 1
4 | 14-15 | 1 | 1
5 | 15-16 | 1 | 1
pffchecklist(正常工作用PHP):
lid | lTitle | lText | aid | cid
--------------------------------
1 | Check1 | hi | 3 | 1
2 | Check2 | world | 4 | 1
ulist.php:
<?php
include('connections/conn.php');
$getList = $_GET['lid'];
$testsql = 'SELECT * FROM pffchecklist where lid=' . $getList . ';';
$testresult = mysqli_query($conn, $testsql);
$getrow = mysqli_fetch_array($testresult);
echo $getrow["lTitle"]; //works
echo $getrow['lText']; // works
$getAgesSql = 'SELECT * FROM pffages where aActive = 1;';
$getAgesResult = mysqli_query($conn,$getAgesSql);
$getAges = mysqli_fetch_array($getAgesResult);
foreach($getAges as $theAges){
echo $theAges['aTitle']; // returns 33111111
echo $theAges['aid']; // returns 33111111
}
?>
同样的结果... 33111111 –
我什么也没得到与编辑。 –