g

이 소스 문제 있는지 봐주시겠어요??

//별점데이터 변수 _ 만족도 $cmtpoint ='0'; $totalcount = '0'; $userrating = '0'; $tbl = "{$g4[write_prefix]}{$bo_table}"; $sql2 = " select wr_8 from $tbl where wr_is_comment > 0 && wr_parent = '$wr_id' && wr_8 > '0' "; $result2 = sql_query($sql2); while($row2 = mysql_fetch_array($result2) ) { $point=$row2[0]; $cmtpoint=$cmtpoint + $point; $totalcount++; } if ($totalcount!=0) { $cmtpoint= $cmtpoint/$totalcount; $cmtpoint= number_format($cmtpoint,2); } //별점데이터 변수 _ 완성도 $cmtpoint2 ='0'; $totalcount2 = '0'; $userrating2 = '0'; $sql3 = " select wr_9 from $tbl where wr_is_comment > 0 && wr_parent = '$wr_id' && wr_9 > '0' "; $result3 = sql_query($sql3); while($row3 = mysql_fetch_array($result3) ) { $point2=$row3[0]; $cmtpoint2=$cmtpoint2 + $point2; $totalcount2++; } if ($totalcount2!=0) { $cmtpoint2= $cmtpoint2/$totalcount2; $cmtpoint2= number_format($cmtpoint2,2); } //별점데이터 변수 _ 대중성 $cmtpoint3 ='0'; $totalcount3 = '0'; $userrating3 = '0'; $sql4 = " select wr_10 from $tbl where wr_is_comment > 0 && wr_parent = '$wr_id' && wr_10 > '0' "; $result4 = sql_query($sql4); while($row4 = mysql_fetch_array($result4) ) { $point3=$row4[0]; $cmtpoint3=$cmtpoint3 + $point3; $totalcount3++; } if ($totalcount3!=0) { $cmtpoint3= $cmtpoint3/$totalcount3; $cmtpoint3= number_format($cmtpoint3,2); } <table width="400" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#EEEEEE" style="border-collapse:collapse; " ="rows" frame="hsides"> <? if($cmtpoint) { ?> <tr> <td width="70" height="25" align="right" bgcolor="#fcfcfc" style="padding-right:30px">만족도</td> <td style="padding-left:15px"><table><tr><td><?echo percentage_graph($cmtpoint,'10',$board_skin_path)?></td><td class=date>( <?=$cmtpoint?> / <?=$totalcount?> )</td></tr></table></td> </tr> <? } ?> <? if($cmtpoint2) { ?> <tr> <td width="70" height="25" align="right" bgcolor="#fcfcfc" style="padding-right:30px">완성도</td> <td style="padding-left:15px"><table><tr><td><?echo percentage_graph($cmtpoint2,'10',$board_skin_path)?></td><td class=date>( <?=$cmtpoint2?> / <?=$totalcount2?> )</td></tr></table></td> </tr> <? } ?> <? if($cmtpoint3) { ?> <tr> <td height="25" align="right" bgcolor="#fcfcfc" style="padding-right:30px">대중성</td> <td style="padding-left:15px"><table><tr><td><?echo percentage_graph($cmtpoint3,'10',$board_skin_path)?></td><td class=date>( <?=$cmtpoint3?> / <?=$totalcount3?> )</td></tr></table></td> </tr> <? } ?> </table> 이걸 정리해야 하는데... select count(wr_8) as wr8_count,
  count(wr_9) as wr9_count,
  count(wr_10) as wr10_count,
  avg(wr_8) as wr8_avg,
  avg(wr_9) as wr9_avg,
  avg(wr_10) as wr10_avg,

from $tbl 
where wr_is_comment > 0 
  and wr_parent = '$wr_id'  ... 위의 소스를 이런식으로 사용해서 정리해서 적용하려 하는데,어떻게 해야 할지.. 
|

댓글 2개

제가 도와드리지요 ^^ 쪽지 주세요~
우왓 감사합니다 ^^ 잘 부탁드려요~
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 1,669
18년 전 조회 3,990
18년 전 조회 1,608
18년 전 조회 1,564
18년 전 조회 2,260
18년 전 조회 1,005
18년 전 조회 2,383
18년 전 조회 1,278
18년 전 조회 1,518
18년 전 조회 1,048
18년 전 조회 1,539
18년 전 조회 1,485
18년 전 조회 1,787
18년 전 조회 1,455
18년 전 조회 1,564
18년 전 조회 1,015
18년 전 조회 1,650
18년 전 조회 1,491
18년 전 조회 2,427
18년 전 조회 1,006