추천받은글 삭제불가 질문드려요.

추천받은글 삭제불가 질문드려요.

QA

추천받은글 삭제불가 질문드려요.

답변 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]}'";
$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쿼리 이프문 변경해보세요

<?

$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번 이상 추천받은 글은 삭제 할 수없습니다.');

?>



이렇게 적어서 해보니 잘 작동되는거 같습니다.
답변 너무 감사합니다. 많은 도움이 되었습니다.

if문을 $good_check['cnt'] 로 변경해보세요

 

<?
$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]}' and mb_id = '{$member[mb_id]}'";
 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 11
© SIRSOFT
현재 페이지 제일 처음으로