이 소스 문제 있는지 봐주시겠어요?? > 그누4 질문답변

그누4 질문답변

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

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

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

본문

//별점데이터 변수 _ 만족도 $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); }
만족도
<?echo percentage_graph($cmtpoint,'10',$board_skin_path)?>( <?=$cmtpoint?> / <?=$totalcount?> )
완성도
<?echo percentage_graph($cmtpoint2,'10',$board_skin_path)?>( <?=$cmtpoint2?> / <?=$totalcount2?> )
대중성
<?echo percentage_graph($cmtpoint3,'10',$board_skin_path)?>( <?=$cmtpoint3?> / <?=$totalcount3?> )
 이걸 정리해야 하는데... 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'  ... 위의 소스를 이런식으로 사용해서 정리해서 적용하려 하는데,어떻게 해야 할지.. 
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로