글 수정시 체크박스 문의좀 드리겠습니다. 정보
글 수정시 체크박스 문의좀 드리겠습니다.본문
최신글에 체크한 부분만 나오게 할려고 글쓰기에서 wr_1을 추가했습니다.
물론 최신글에서 선택한대로는 잘 나옵니다.
근데 체크한 부분을 수정을 하려고 하면 체크가 해제가 되어 있네요.
이걸 기억하게끔 하고 싶습니다.
<tr>
<td class=mw_basic_write_title>등록</td>
<td><input type=checkbox name=wr_1 itemname="등록" value="1" >
<td>
</tr>
최신글 소스는 아래와 같습니다.
// 체크한 부분만 최신글에서 순서대로 보이기------------------------------------
function latest_select($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_1 <> '' order by wr_1, wr_id asc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
입니다.
물론 최신글에서 선택한대로는 잘 나옵니다.
근데 체크한 부분을 수정을 하려고 하면 체크가 해제가 되어 있네요.
이걸 기억하게끔 하고 싶습니다.
<tr>
<td class=mw_basic_write_title>등록</td>
<td><input type=checkbox name=wr_1 itemname="등록" value="1" >
<td>
</tr>
최신글 소스는 아래와 같습니다.
// 체크한 부분만 최신글에서 순서대로 보이기------------------------------------
function latest_select($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_1 <> '' order by wr_1, wr_id asc limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
입니다.
( select a.* , ( select sum(co_count) as co_count from g4_qa_choose where mb_id=a.mb_id and bo_table = 'g4_qa' ) as q_co_count from `g4_write_g4_qa` a where wr_parent = '175625' and wr_8 != '' and wr_is_comment = 1 and CONVERT(wr_7, UNSIGNED) >= 5 group by wr_content having max(wr_7) order by CONVERT(wr_7, UNSIGNED) desc limit 3 )
1055 : Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sir.a.wr_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
error file : /15sir/bbs/board.php