當我運行第二個查詢來選擇部門時,它將返回我的部門列表,如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