추천받은글 삭제불가 질문드려요. 채택완료
</p>
<p> </p>
<p><?</p>
<p>$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);</p>
<p>if ($good_check >= 3 && !$is_admin)
alert('3번 이상 추천받은 글은 삭제 할 수 없습니다.');</p>
<p>?></p>
<p> </p>
<p>
게시판에 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쿼리 이프문 변경해보세요
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
$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]}'";
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
$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['cnt'] >= 3 && !$is_admin)
alert('3번 이상 추천받은 글은 삭제 할 수 없습니다.');
?>
if문에 이렇게 적었는데도 안되네요..
답변주셔서 감사합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
$sql = "select count(*) as cnt from {$g5['board_good_table']} where bo_table = '{$bo_table}' and wr_id = '{$write[wr_id]}'";
$good_check = sql_fetch($sql);
if ($good_check['cnt'] >= 3 && !$is_admin)
alert('3번 이상 추천받은 글은 삭제 할 수없습니다.');
?>
이렇게 적어서 해보니 잘 작동되는거 같습니다.
답변 너무 감사합니다. 많은 도움이 되었습니다.