我有 2 张桌子
1 个表 = 文件
code | title
luLidwhSl8hmN0T6RsLaDmxAB09UZcX |这是Rar标题
4Xwvm1C3yTQJK7CnmxorUDI7sNSvcBK |这是JPG标题
...
2 表 = 命中
page_name | hits
下载.php?code=luLidwhSl8hmN0T6RsLaDmxAB09UZcX |102
下载.php?code=4Xwvm1C3yTQJK7CnmxorUDI7sNSvcBK |87
...
我的查询是:
include('db.inc.php');
$query = mysql_query("SELECT t1.code, t1.title, RIGHT(t2.page_name, 31) as t2.page_name, t2.hits FROM files t1 INNER JOIN hits t2 ON t1.code= RIGHT(t2.page_name, 31) as t2.page_name ORDER by t2.hits DESC LIMIT 1, 7");
while ($result = mysql_fetch_assoc($query)) {
echo ' <div id="linkstyle"><strong><a href="http://localhost/edu/filesupload/download.php?code='. $result['t1.code'] . ' ">' , $result['t1.title'] , '</a></strong><br></div>';
}
我收到这个错误
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Edu\filesupload\index.php on line 104
哪里有问题?