嘿伙计们,我很难在 mysql 中从我的表中打印所有内容。它只打印表的最后一条记录。先感谢您。
这是我的语法:
//query
$search_query="SELECT offer_no,day,time from offer where subject_id = '" .$search_subject_id ."';";
//execution of query
$result = mysql_query($search_query,$dbhandle);
//fetching result
while ($row = mysql_fetch_array($result)) {
$results =$row['offer_no'] . " " .$row['day']. " " .$row['time'];
}
输出:
1001 小家电 7:00-8:00
预期输出:
1001 MWF 7:00-8:00, 1002 MWF 8:00-9:00