갑자기 에러가 납니다 1146 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

갑자기 에러가 납니다 1146 정보

갑자기 에러가 납니다 1146

본문

select count(wr_id) as blog_count, conv(substring(wr_datetime, 9, 2), 10, 10) as blog_day from g4_write_comm04 where wr_datetime>='2006-11-01' and wr_datetime<='2006-11-31 9' group by left(wr_datetime, 10)
1146 : Table 'user_dohumn.g4_write_comm04' doesn't exist
error file : /dk2/bbs/board.php
 
이건또 뭔 에러랍니까??
 
게시판을 모두 생성하고 글도 작성해보고 디자인 작업후에 코딩을 할려고 보니 갑자기 에러가 나네요...
게시판 자체가 아예 안보이네요..에구 이런..
 

댓글 전체

어!

이놈이 뭔 이유인지 모르지만 착한아이님 달력만 불러오면 그러네요...

이유를 모르겠네요

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=163

소스내용 입니다.

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cellh  = 21;
$cellw  = 21;
?>

<style type="text/css">
td.title    {text-align: center; padding-top: 1pt; padding-bottom: 1pt; height: 25px; font-weight:bold;}
td.invalid  {
text-align: center; padding-top: 2pt; height:<?=$cellh?>; width:<?=$cellh?>;
background-image: url(<?=$g4[path]?>/file/calendar/mini1.gif);
}

td.valid    {
text-align: center; padding-top: 2pt; height:<?=$cellh?>; width:<?=$cellh?>;
background-image: url(<?=$g4[path]?>/file/calendar/mini2.gif);
}

td.today    {
text-align: center; padding-top: 2pt; height:<?=$cellh?>; width:<?=$cellh?>;
background-image: url(<?=$g4[path]?>/file/calendar/mini3.gif);
}

p.title    {font-size: 1em; font-weight:bold}
p.sunday    {text-align: center; font-size: 8pt; color: #ff00ff;}
p.saturday  {text-align: center; font-size: 8pt; color: #3366cc;}
p.weekday  {text-align: center; font-size: 8pt;}

a:link.writeday, a:visited.writeday  {text-align: center; font-size: 8pt; color: #fd7100; font-weight:bold;}
</style>

<?
function SkipOffset($no)
{
  for ($i = 1; $i <= $no; $i++) {
    echo " <TD class=invalid><p></p></TD> \n";
  }
}

//---- 오늘 날짜
$thisyear  = date('Y');  // 2000
$thismonth = date('n');  // 1, 2, 3, ..., 12
$thisday  = date('j');  // 1, 2, 3, ..., 31

//------ $year, $month 값이 없으면 현재 날짜
if (!$year) { $year = $thisyear; }
if (!$month) { $month = $thismonth; }

//------ 날짜의 범위 체크
if (($year > 9999) or ($year < 0)){
alert("연도는 0~9999년만 가능합니다.");
}

if (($month > 12) or ($month < 0)){
alert("달은 1~12만 가능합니다.");
}

$maxdate = date(t, mktime(0, 0, 0, $month, 1, $year));  // the final date of $month

$prevmonth = $month - 1;
$nextmonth = $month + 1;
$prevyear = $year;
$nextyear = $year;
if ($month == 1) {
  $prevmonth = 12;
  $prevyear = $year - 1;
} elseif ($month == 12) {
  $nextmonth = 1;
  $nextyear = $year + 1;
}

$ti_link = "";

if($bo_table) {
$sql = "select count(wr_id) as blog_count, conv(substring(wr_datetime, 9, 2), 10, 10) as blog_day
    from g4_write_$bo_table
where wr_datetime>='$year-$month-01' and wr_datetime<='$year-$month-31 9'
group by left(wr_datetime, 10) ";
$result = sql_query($sql);

$write_blog = array_fill(1,$maxdate,-1);

for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$write_blog[$row[blog_day]] = $row[blog_count];
}
mysql_free_result($result);

$ti_link = "board.php";
}
?>

<TABLE width=<?=$cellw*7?> cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD width=100% colspan=7 class=title>
<a href="<?=$ti_link?>?bo_table=<?=$bo_table?>&year=<?=$prevyear?>&month=<?=$prevmonth?>">
<img src='<?=$g4[path]?>/file/calendar/first.gif' border=0 align=absmiddle width=17 height=13>
</a>
    <?=$year?> 년 <?=$month?> 월
<a href="<?=$ti_link?>?bo_table=<?=$bo_table?>&year=<?=$nextyear?>&month=<?=$nextmonth?>">
<img src='<?=$g4[path]?>/file/calendar/end.gif' border=0 align=absmiddle width=17 height=13>
</a>
</TD>
</TR>

<TR>
<td class=sunday><p class=sunday>일</p></td>
<td class=weekday><p class=weekday>월</p></td>
<td class=weekday><p class=weekday>화</p></td>
<td class=weekday><p class=weekday>수</p></td>
<td class=weekday><p class=weekday>목</p></td>
<td class=weekday><p class=weekday>금</p></td>
<td class=saturday><p class=saturday>토</p></td>
</TR>

<TR>
<?
$date = 1;
while ($date <= $maxdate) {
  if ($date == '1') {
    $offset = date('w', mktime(0, 0, 0, $month, $date, $year));  // 0: sunday, 1: monday, ..., 6: saturday
    SkipOffset($offset);
  }

  if ( $date == $thisday  &&  $year == $thisyear &&  $month == $thismonth) {
    $cstyle = 'today';
  } else {
    $cstyle = 'valid';
  }

  switch ($offset) {            // 요일에 따라 날짜의 색깔 결정
    case 0: $dstyle = 'sunday';
            break;
    case 6: $dstyle = 'saturday';
            break;
    default: $dstyle = 'weekday';
  }

  $date_array = array(sprintf('%04d', $year), sprintf('%02d', $month), sprintf('%02d', $date));
  $date_stext = implode("-", $date_array);

  if($bo_table && $write_blog[$date] > 0) {
  $date_link = "<p><a href='board.php?bo_table=$bo_table&sfl=wr_datetime&sop=and&stx=$date_stext' class=writeday>{$date}</a></p>";
  } else {
$date_link = "<p class=$dstyle>{$date}</p>";
  }

  echo " <TD class=$cstyle>{$date_link}</TD> \n";

  $date++;
  $offset++;

  if ($offset == 7) {
    echo "</TR> \n";
    if ($date <= $maxdate) {
      echo "<TR> \n";
    }
    $offset = 0;
  }

} // end of while

if ($offset != 0) {
  SkipOffset((7-$offset));
  echo "</TR> \n";
}
?>
</TABLE>
댓글의 소스를 통째로 긁어가서 테스트해보니 에러없이 잘나오고 있는데요.

혹시나 모르므로 착한아이님의 달력자료에 있는 prosper님의 코멘트를 참조해 보세요.

 
php4.2.x 이하버전에서는 array_fill() 함수를 사용하지 못함으로
달력을 사용할수 없습니다.

사용하기 위해선 lib/developer.lib.php 파일을 만들어

다음 함수를 삽입시키신뒤  해당 해더에서 include_once 하셔야 합니다.
-----------------------------------------------------------------------------------------------------
<?PHP
if (!defined('_GNUBOARD_')) exit;

// For PHP version < 4.2.0 missing the array_fill function,
// I provide here an alternative. -Philippe

function array_fill($iStart, $iLen, $vValue) {
  $aResult = array();
  for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) {
      $aResult[$iCount] = $vValue;
  }
  return $aResult;
}
?>
array_fill() 함수를 같이 넣어서 테스트를 해보세요....^^

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cellh  = 21;
$cellw  = 21;
?>

<style type="text/css">
td.title    {text-align: center; padding-top: 1pt; padding-bottom: 1pt; height: 25px; font-weight:bold;}
td.invalid  {
text-align: center; padding-top: 2pt; height:<?=$cellh?>; width:<?=$cellh?>;
background-image: url(<?=$g4[path]?>/file/calendar/mini1.gif);
}

td.valid    {
text-align: center; padding-top: 2pt; height:<?=$cellh?>; width:<?=$cellh?>;
background-image: url(<?=$g4[path]?>/file/calendar/mini2.gif);
}

td.today    {
text-align: center; padding-top: 2pt; height:<?=$cellh?>; width:<?=$cellh?>;
background-image: url(<?=$g4[path]?>/file/calendar/mini3.gif);
}

p.title    {font-size: 1em; font-weight:bold}
p.sunday    {text-align: center; font-size: 8pt; color: #ff00ff;}
p.saturday  {text-align: center; font-size: 8pt; color: #3366cc;}
p.weekday  {text-align: center; font-size: 8pt;}

a:link.writeday, a:visited.writeday  {text-align: center; font-size: 8pt; color: #fd7100; font-weight:bold;}
</style>

<?
function array_fill($iStart, $iLen, $vValue) {
  $aResult = array();
  for ($iCount = $iStart; $iCount < $iLen + $iStart; $iCount++) {
      $aResult[$iCount] = $vValue;
  }
  return $aResult;
}


function SkipOffset($no)
{
  for ($i = 1; $i <= $no; $i++) {
    echo " <TD class=invalid><p></p></TD> \n";
  }
}

//---- 오늘 날짜
$thisyear  = date('Y');  // 2000
$thismonth = date('n');  // 1, 2, 3, ..., 12
$thisday  = date('j');  // 1, 2, 3, ..., 31

//------ $year, $month 값이 없으면 현재 날짜
if (!$year) { $year = $thisyear; }
if (!$month) { $month = $thismonth; }

//------ 날짜의 범위 체크
if (($year > 9999) or ($year < 0)){
alert("연도는 0~9999년만 가능합니다.");
}

if (($month > 12) or ($month < 0)){
alert("달은 1~12만 가능합니다.");
}

$maxdate = date(t, mktime(0, 0, 0, $month, 1, $year));  // the final date of $month

$prevmonth = $month - 1;
$nextmonth = $month + 1;
$prevyear = $year;
$nextyear = $year;
if ($month == 1) {
  $prevmonth = 12;
  $prevyear = $year - 1;
} elseif ($month == 12) {
  $nextmonth = 1;
  $nextyear = $year + 1;
}

$ti_link = "";

if($bo_table) {
$sql = "select count(wr_id) as blog_count, conv(substring(wr_datetime, 9, 2), 10, 10) as blog_day
    from g4_write_$bo_table
where wr_datetime>='$year-$month-01' and wr_datetime<='$year-$month-31 9'
group by left(wr_datetime, 10) ";
$result = sql_query($sql);

$write_blog = array_fill(1,$maxdate,-1);

for ($i = 0; $row = mysql_fetch_array($result); $i++) {
$write_blog[$row[blog_day]] = $row[blog_count];
}
mysql_free_result($result);

$ti_link = "board.php";
}
?>

<TABLE width=<?=$cellw*7?> cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD width=100% colspan=7 class=title>
<a href="<?=$ti_link?>?bo_table=<?=$bo_table?>&year=<?=$prevyear?>&month=<?=$prevmonth?>">
<img src='<?=$g4[path]?>/file/calendar/first.gif' border=0 align=absmiddle width=17 height=13>
</a>
    <?=$year?> 년 <?=$month?> 월
<a href="<?=$ti_link?>?bo_table=<?=$bo_table?>&year=<?=$nextyear?>&month=<?=$nextmonth?>">
<img src='<?=$g4[path]?>/file/calendar/end.gif' border=0 align=absmiddle width=17 height=13>
</a>
</TD>
</TR>

<TR>
<td class=sunday><p class=sunday>일</p></td>
<td class=weekday><p class=weekday>월</p></td>
<td class=weekday><p class=weekday>화</p></td>
<td class=weekday><p class=weekday>수</p></td>
<td class=weekday><p class=weekday>목</p></td>
<td class=weekday><p class=weekday>금</p></td>
<td class=saturday><p class=saturday>토</p></td>
</TR>

<TR>
<?
$date = 1;
while ($date <= $maxdate) {
  if ($date == '1') {
    $offset = date('w', mktime(0, 0, 0, $month, $date, $year));  // 0: sunday, 1: monday, ..., 6: saturday
    SkipOffset($offset);
  }

  if ( $date == $thisday  &&  $year == $thisyear &&  $month == $thismonth) {
    $cstyle = 'today';
  } else {
    $cstyle = 'valid';
  }

  switch ($offset) {            // 요일에 따라 날짜의 색깔 결정
    case 0: $dstyle = 'sunday';
            break;
    case 6: $dstyle = 'saturday';
            break;
    default: $dstyle = 'weekday';
  }

  $date_array = array(sprintf('%04d', $year), sprintf('%02d', $month), sprintf('%02d', $date));
  $date_stext = implode("-", $date_array);

  if($bo_table && $write_blog[$date] > 0) {
  $date_link = "<p><a href='board.php?bo_table=$bo_table&sfl=wr_datetime&sop=and&stx=$date_stext' class=writeday>{$date}</a></p>";
  } else {
$date_link = "<p class=$dstyle>{$date}</p>";
  }

  echo " <TD class=$cstyle>{$date_link}</TD> \n";

  $date++;
  $offset++;

  if ($offset == 7) {
    echo "</TR> \n";
    if ($date <= $maxdate) {
      echo "<TR> \n";
    }
    $offset = 0;
  }

} // end of while

if ($offset != 0) {
  SkipOffset((7-$offset));
  echo "</TR> \n";
}
?>
</TABLE>
알려주신데로 해봐도 안되네요^^

인덱스에선 잘 나오고 게시판을 넘어가면 안나오는 요상한 현상...하하

꼭 필요한것은 아닌데 열받네요..

헐랭이님 답변 감사하구요

다른것부터 해 놓고 손봐야겠네요^^

감사합니다.
>>where wr_datetime>='2006-11-01' and wr_datetime<='2006-11-31 9'

질문 원글의 윗 에러 부분의 끝에 9가 어디서 왔는지 찾아 보세요....^^

..요넘이네요....첫번째 댓글 중에

where wr_datetime>='$year-$month-01' and wr_datetime<='$year-$month-31 9'

그리고

1146 : Table 'user_dohumn.g4_write_comm04' doesn't exist

는 g4_write_comm04 의 게시판이 있기나 합니까?.....
호호호~~**

그래서 전 죽었다가 깨어나도 한줄 더 쓰는 한이 있어도 위와 같이 처리를 하지 않습니다.

그래야 혹시나 옮기거나 다른 부분을 수정하더라도 용이하지요...^^
하하하...귀신이군요^^

기존 사이트를 다른분이 만들었는데 수정하는것 보다 새로 하는게 나을것 같아

접두사를 바꿔서 설치를 했죠!!!

고놈이 영향이 있는것인가봐요...
저도 처음 config.php접두사 바꿔서 2개 설치 해봤으니 난감하죠...하하

설치 안해도 됩니다.

다만 궁금해서리...

지금은 그누를 2개 설치했지만 작업후에 필요없는 1개를 지우게되면 작동을 하나요?
아니유....

가능하면

$tmp_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름


~~~ from $tmp_table  식으로 바꾸어 주시는게 좋습니다....^^
링크 부분과 퀴리부분을 잘 연결하면 그날짜의 해당글이나 뭐 등등 가능 합니다...^^

제홈엔 폼으로 겅어두고 커뮤니티 그룹에 그날짜에 글이 있다면 다리 표시를 하고

클릭하면 그날 커뮤니티에 올라온 글 목록으로 이동을 합니다..^^

이쁘게 손보셔서 하나 부탁드립니다...^^
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT