本帖最后由 jncn52 于 2010-07-13 07:39:55 编辑

解决方案 »

  1.   

    SELECT count(*),FID FROM {$tablepre}favoriteforums WHERE fid='$fid'
      

  2.   

    SQL: SELECT count(*),fid FROM [Table]favoriteforums WHERE fid='2'
    Error: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
    Errno.: 1140Similar error report has been dispatched to administrator before.为什么改了后会这样的??
      

  3.   

    count(*)和fid一起查询的使用要使用group by语句,如下
    select fid, count(*) from [Table]favoriteforums where fid='2' group by fid
      

  4.   

    $forum[list] = $db->result_first("SELECT fid, count(*) FROM {$tablepre}favoriteforums WHERE fid='$fid' GROUP BY fid");这样改还是没有效果...
      

  5.   


    $uids = array();
    $query = $db->query("SELECT uid FROM {$tablepre}favoriteforums WHERE fid='$fid'")
    while($row = $db->fetch($query)) {
    $uids[] = $row['uid'];
    }
    $forum['userlist'] = implode(',', $uids);
      

  6.   

    SELECT f.*,m.`username`
    FROM `{$tablepre}favoriteforums`  f
    left join `{$tablepre}members`  m on f.`uid`=m.`uid`
    WHERE f.`fid`='$fid' order by f.`dateline` desc
      

  7.   

    $forum[list] = $db->query("SELECT f.`uid`,f.`fid`,m.`username`
    FROM `{$tablepre}favoriteforums` f
    left join `{$tablepre}members` m on f.`uid`=m.`uid`
    WHERE f.`fid`='$fid' order by f.`dateline` desc");需要你自己在显示的模板页里,循环显示出来,可以加对应的连接
      

  8.   

    完整的应该是:$sql="SELECT f.`uid`,f.`fid`,m.`username`
    FROM `{$tablepre}favoriteforums` f
    left join `{$tablepre}members` m on f.`uid`=m.`uid`
    WHERE f.`fid`='$fid' order by f.`dateline` desc";
    $query = $db->query($sql);
    while($rt = $db->fetch_array($query)) {
    $forum[list][]=$rt;
    }
      

  9.   

    我试了8楼的方法...只显示 Array...其他方法都不行...继续求助......