추천받은글 삭제불가 질문드려요.
본문
<?
$sql = "select count(*) as cnt from {$g5['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$view[wr_id]}' and mb_id = '{$member[mb_id]}'";
$good_check = sql_fetch($sql);
if ($good_check >= 3 && !$is_admin)
alert('3번 이상 추천받은 글은 삭제 할 수 없습니다.');
?>
게시판에 delete.skin.php 에
질문)
3번이상 추천받은 글은 글작성자가 삭제할 수 없도록 할려는데요.
위 처럼 적어보았는데 안되더라구요.
어떻게 작성해야하는지 알려주시면 고맙겠습니다. ^^
!-->
답변 3
다시 보니 추천 3번인거면
$sql
=
"select count(*) as cnt from {$g5['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$view[wr_id]}' and mb_id = '{$member[mb_id]}'"
;
이 쿼리가 아니라
$sql
=
"select wr_good from {$g5['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$view[wr_id]}'"
;
if ($good_check['wr_good
'] >= 3 && !$is_admin)
z쿼리 이프문 변경해보세요
if문을 $good_check['cnt'] 로 변경해보세요
$sql = "select count(*) as cnt from {$g5['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$write[wr_id]}' and mb_id = '{$member[mb_id]}'";
답변을 작성하시기 전에 로그인 해주세요.