sql_fetch_array 에러 !!??
본문
코멘트 스타포인트(정상)를 리스트(에러)에 불러오지 못합니다
>> http://jone.in-best.com/bbs/board.php?bo_table=video
list.skin.php
<?
$cmtpoint ='0';
$totalcount = '0';
$userrating = '0';
$tbl = "{$g5[write_prefix]}{$bo_table}";
$sql2 = " select wr_3 from $tbl where wr_is_comment > 0 && wr_parent = '{$list[$i][wr_id]}' && wr_3 > '0' ";
$result2 = sql_query($sql2);
while($row2 = sql_fetch_array($result2) ) {
$point=$row2[0];
$cmtpoint=$cmtpoint + $point;
$totalcount++;
}
if ($totalcount!=0) {
$cmtpoint= $cmtpoint/$totalcount;
$cmtpoint= number_format($cmtpoint,2);
}
echo "<a href='{$list[$i][href]}'>";
?>
<? if ($cmtpoint > "9"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png">
<? } else if ($cmtpoint > "8"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st2.png">
<? } else if ($cmtpoint > "7"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "6"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st2.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "5"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "4"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st2.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "3"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "2"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st2.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "1"){?>
<img src="<?=$board_skin_url?>/img/st1.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else if ($cmtpoint > "0"){?>
<img src="<?=$board_skin_url?>/img/st2.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? } else {?>
<img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png"><img src="<?=$board_skin_url?>/img/st3.png">
<? }?>
</span>
<!-- ★★ 스타포인트 End-->
>> http://jone.in-best.com/bbs/board.php?bo_table=video&wr_id=87
view_comment.skin.php
<!-- ★★★ 스타포인트 -->
<? if ($list[$i][wr_3] == "10"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif">
<? } else if ($list[$i][wr_3] == "9"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st2.gif">
<? } else if ($list[$i][wr_3] == "8"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "7"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st2.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "6"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "5"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st2.gif"><img src="<?=$board_skin_path?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "4"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_path?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "3"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st2.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_path?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "2"){?>
<img src="<?=$board_skin_url?>/img/st1.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else if ($list[$i][wr_3] == "1"){?>
<img src="<?=$board_skin_url?>/img/st2.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? } else {?>
<img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif"><img src="<?=$board_skin_url?>/img/st3.gif">
<? }?>
<!-- ★★★ 스타포인트 -->
<!-- ★★★ 스타포인트 -->
<select style="behavior: url('<?=$g5[path]?>/js/selectBox.htc');" name='wr_3' itemname="Point">
<option value=''>★ STAR-POINT </option>
<option value='10'>★★★★★ 10/P
<option value='9'>★★★★★ 9/P
<option value='8'>☆★★★★ 8/P
<option value='7'>☆★★★★ 7/P
<option value='6'>☆☆★★★ 6/P
<option value='5'>☆☆★★★ 5/P
<option value='4'>☆☆☆★★ 4/P
<option value='3'>☆☆☆★★ 3/P
<option value='2'>☆☆☆☆★ 2/P
<option value='1'>☆☆☆☆★ 1/P
</select>
<!-- ★★★ 스타포인트 -->
답변 4
$sql2 = " select wr_3 from $tbl where wr_is_comment > 0 && wr_parent = '{$list[$i][wr_id]}' && wr_3 > '0' ";
-->
$sql2 = " select wr_3 from $tbl where wr_is_comment > 0 AND wr_parent = '{$list[$i][wr_id]}' && wr_3 > '0' ";
sql 구문에서는 && 안 씁니다.
while($row2 = sql_fetch_array($result2) ) {
$point=$row2[0]; ----> $point=$row2[wr_3];
왈계란님, 감사 합니다 !!!!!
간단히 수정하면 될줄 알고 질의 한건데 .... ㅠㅠ
일단, 체택으로 처리하고 추후 도움/문의 드리겠슴다.
좋은 하루되시길... ^^~