当我运行第二个查询来选择部门时,它将返回我的部门列表,如20条记录,然后将数以千计的空白输入返回页面,在浏览器中冻结我做了什么错误?MySQL查询返回成千上万的空结果
mysql_select_db("ita", $con);
$results = mysql_query("SELECT * FROM `Colleges`");
$colleges = array();
while($row = mysql_fetch_assoc($results))
{
$colleges[] = array("Name" => $row['Name'], "Value" => $row['Value'], "ID" => $row['CollegeID']);
}
$collegecount = count($colleges);
$depts = array();
$result1 = mysql_query("SELECT * FROM `Departments` WHERE uid = `$uid`");
while($row = mysql_fetch_assoc($result1))
{
$depts = array("Name" => $row['Name'], "Value" => $row['Value'], "ID" => $row['CollegeID']);
}
$result = mysql_query("SELECT * FROM `users` WHERE wmuid = '$uid'");
while($row = mysql_fetch_assoc($result)){
//POPULATE FORM FIELDS FROM DB
看起来不像你向我们展示问题代码。没有什么东西看起来写任何东西到页面上。 – Marvo
用户有多少条目? – Randy