게시판에 글을 추천한 사람 아이디 추출 정보
게시판에 글을 추천한 사람 아이디 추출본문
게시판에 글을 추천한 사람 아이디 추출하는데는 성공을했는데 아이디 말고 별명으로 추출하고 싶은데 그건 어떻게 하나요?
<? //추천인 아이디 출력(비추천은 good -> nogood)
$sql = " select * from $g4[board_good_table] where bo_table ='$bo_table' and wr_id='$wr_id' and bg_flag='good' order by bg_id desc ";
$result = sql_query($sql);
while($row = sql_fetch_array($result)){
echo $row[mb_id]."|";
}
?>
현재 이걸 사용하고 있습니다 어디를 어떻게 수정해야할지 꼭좀 해결 해주세요 초보라 잘모릅니다 ㅜㅜ
<? //추천인 아이디 출력(비추천은 good -> nogood)
$sql = " select * from $g4[board_good_table] where bo_table ='$bo_table' and wr_id='$wr_id' and bg_flag='good' order by bg_id desc ";
$result = sql_query($sql);
while($row = sql_fetch_array($result)){
echo $row[mb_id]."|";
}
?>
현재 이걸 사용하고 있습니다 어디를 어떻게 수정해야할지 꼭좀 해결 해주세요 초보라 잘모릅니다 ㅜㅜ
댓글 전체

<? //추천인 아이디 출력(비추천은 good -> nogood)
$sql = " select * from $g4[board_good_table] where bo_table ='$bo_table' and wr_id='$wr_id' and bg_flag='good' order by bg_id desc ";
$result = sql_query($sql);
while($row = sql_fetch_array($result)){
list($mb_nick) = mysql_fetch_array(mysql_query("select mb_nick from {$g4[member_table]} where mb_id='".$row['mb_id']."'"));
echo $mb_nick."|";
}
?>
이렇게 해보세요
$sql = " select * from $g4[board_good_table] where bo_table ='$bo_table' and wr_id='$wr_id' and bg_flag='good' order by bg_id desc ";
$result = sql_query($sql);
while($row = sql_fetch_array($result)){
list($mb_nick) = mysql_fetch_array(mysql_query("select mb_nick from {$g4[member_table]} where mb_id='".$row['mb_id']."'"));
echo $mb_nick."|";
}
?>
이렇게 해보세요
감사합니다 깔끔하게 해결했습니다. 마인드님이 저번에도 저 몇번 도와주신거 같은데 넘 감사드립니다