解决方案 »

  1.   

    有无错误信息?$result = mysql_query($sql, $db) or die(mysql_error());  这样写看看是否有报错信息。
      

  2.   

    SELECT entries.*, categories.cat From entries, categories
        WHERE entries.cat_id = categories.id
        ORDER BY dateposted DESC
        LIMIT 1在phpmyadin中执行可以查询到吗?
      

  3.   

    $sq1 = "SELECT entries.*, categories.cat From entries, categories
        WHERE entries.cat_id = categories.id
        ORDER BY dateposted DESC
        LIMIT 1;";去掉LIMIT 1后面那个分号。
      

  4.   

    $sq1 = "SELECT entries.*, categories.cat From entries, categories
        WHERE entries.cat_id = categories.id
        ORDER BY dateposted DESC
        LIMIT 1;";多了;
      

  5.   

    先要确定SQL是不是正确连接,如果可以执行一条简单的查询语句看看数据库选择,表前缀是不是正确的,如果这些都是正确的,那就是SQL查询语句有问题
     
    如果你是myphpadmin的话把查询条件复制进去执行下,就知道是不是语句错误了
      

  6.   

    各位,这个问题我已经解决了,其中两处的变量不一到处,$sq1 = "SELECT entries.*, categories.cat From entries, categories
        WHERE entries.cat_id = categories.id
        ORDER BY dateposted DESC
        LIMIT 1;";
    这个变量是$sq1, 最后一个搞成了数字1, 应该是小写的字母L