有无错误信息?$result = mysql_query($sql, $db) or die(mysql_error()); 这样写看看是否有报错信息。
SELECT entries.*, categories.cat From entries, categories WHERE entries.cat_id = categories.id ORDER BY dateposted DESC LIMIT 1在phpmyadin中执行可以查询到吗?
$sq1 = "SELECT entries.*, categories.cat From entries, categories WHERE entries.cat_id = categories.id ORDER BY dateposted DESC LIMIT 1;";去掉LIMIT 1后面那个分号。
$sq1 = "SELECT entries.*, categories.cat From entries, categories WHERE entries.cat_id = categories.id ORDER BY dateposted DESC LIMIT 1;";多了;
WHERE entries.cat_id = categories.id
ORDER BY dateposted DESC
LIMIT 1在phpmyadin中执行可以查询到吗?
WHERE entries.cat_id = categories.id
ORDER BY dateposted DESC
LIMIT 1;";去掉LIMIT 1后面那个分号。
WHERE entries.cat_id = categories.id
ORDER BY dateposted DESC
LIMIT 1;";多了;
如果你是myphpadmin的话把查询条件复制进去执行下,就知道是不是语句错误了
WHERE entries.cat_id = categories.id
ORDER BY dateposted DESC
LIMIT 1;";
这个变量是$sq1, 最后一个搞成了数字1, 应该是小写的字母L