姬長信(Redy)

PHP:警告:sort()期望参数1是数组,资源给定


参见英文答案 > mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource or result????????????????????????????????????32个
我想用sort()函数排列表列表数组,但我得到同样的警告
?我的代码如下:
 

我得到的警告是:

Warning: sort() expects parameter 1 to be array, resource given in C:/wamp/www/Copy (4)       of st_db_1/test_2.php on line 9
Warning: Invalid argument supplied for foreach() in C:/wamp/www/Copy (4) of st_db_1/test_2.php on line 10