<?php
session_start();
include("dbconnect.php");
$sql="select * from $_POST[select_catalog_query]";
$rslt=mysql_query($sql);
if(!mysql_fetch_array($rslt))
{
echo "<script type='text/javascript'>\n";
echo "alert('There is No Data');\n";
echo "</script>";
echo "<script>document.location.href='admin.php'</script>";
}
while($row = mysql_fetch_array($rslt))
{
echo "<tr>";
echo "<td>$row[id]</td>";
$sql1 = "select * from login WHERE id=$row[id]";
$rs = mysql_query($sql1);
$rw1 = mysql_fetch_array($rs);
echo "<td>$row[firstName]</td>";
echo "<td>$row[lastName]</td>";
echo "<td>$row[gender]</td>";
echo "<td>$row[phone]</td>";
echo "<td>$row[email]</td>";
echo "<td>$rw1[type]</td>";
echo "<td>$rw1[status]</td>";
echo "</tr>";
}
?>
我的第一个表中有 3 个数据...bt 在输出中仅显示 2 个数据...最后插入的数据未显示。它的解决方案是什么?在while循环中,当我对登录表执行第二次查询时,会给出这样的警告,
mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\myfile\as1\selectAdmin.php on line 41
我该如何执行第二次查询?