최신글 오류 메세지좀 도와주세요
본문
아래처럼 나왔는데
인덱스에서이렇게 인크루드 시켰는데
<? echo latest("cook_jq", "banner|main", 4, 25, 0); //배너 ?>
아랫처럼 메세지가 나오네요
G4 스킨을 수정하는중입니다/
select * from g5_write_banner|main where wr_is_comment = 0 order by wr_num limit 0, 4
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '|main where wr_is_comment = 0 order by wr_num limit 0, 4' at line 1
error file : /yc5/shop/index.php
<div id="featured" >
<div id="featured1">
<!--div class="title"><img src="<?=$g4[path]?>/img/set_title.png" /></div-->
<div style="position: absolute; width: 185px; z-index:20; left:5px; top:10px;">
</div>
<ul class="ui-tabs-nav">
<li style="height:0px"></li>
<?
for ($i=0; $i<count($list); $i++) {
$file01 = "$data_path/".urlencode($list[$i][file][0][file]);
$file02 = "$data_path/".urlencode($list[$i][file][1][file]);
$file03 = "$data_path/".urlencode($list[$i][file][2][file]);
$link_01 = $list[$i][wr_link1];
$j = $i + 1;
if ($j == "1") {
$selected='ui-tabs-selected';
} else {
$selected='';}
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// 업로드된 파일이 이미지라면
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb))
$thumfile = "$thumb";
else
//이미지가 없으면
$thumfile="$latest_skin_path/img/noimg.gif";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?>
<li class="ui-tabs-nav-item <?=$selected?>" id="nav-fragment-<?=$j?>"><a href="#fragment-<?=$j?>"><img src="<?=$file02?>" alt="" /></a></li>
<? }?>
</ul></div>
<!-- First Content -->
<?
for ($i=0; $i<count($list); $i++) {
$file01 = "$data_path/".urlencode($list[$i][file][0][file]);
$file02 = "$data_path/".urlencode($list[$i][file][1][file]);
$file03 = "$data_path/".urlencode($list[$i][file][2][file]);
$link_01 = $list[$i][wr_link1];
$j = $i + 1;
if ($j == "1") {
$selected='ui-tabs-selected';
} else {
$selected='';}
$j = $i + 1;
if ($j == "1") {
$hide='';
} else {
$hide='ui-tabs-hide'; }
?>
<div id="fragment-<?=$j?>" class="ui-tabs-panel <?=$hide?>" style="background:url(<?php echo $file03 ?>)">
<div style="width: 940px; height: 350px; margin:0 auto; position: relative; z-index: 3;">
<a href='<?=$link_01?>'><img src="<?=$file01?>" alt="" width="940" height="350" /></a>
</div></div>
<? }?>
</div>
</div>
어렵네요
G5d용으로 수정하려면..대략 어느정도 비용이? ㅠㅠ
답변 3
G4에서 쓰던거 그대로 복사해온겁니다 <--- 그것은 G4 그대로 사용하고 G5 latest.lib.php에
G4 latest.lib 것을 복사해서 붙여넣고 latest2(~~~) 처럼 이름을 바꾸세요
출력할때는<? echo latest2("cook_jq", "banner|main", 4, 25, 0); //배너 ?>
테이블 이름에 특수문자가 들어가서 그런듯 합니다.
g5_write_banner|main <<== "|" <<== 이거 때문에 에러난듯 합니다.
테이블 이름이 " g5_write_banner|main " 이게 정말 맞습니다.
|는 카테고리구분하는 문자 , 즉 테이블 이름과 무관하면
그러면 쿼리문에 " | 카테고리" 를 쓰시면 당연히 에러가 납니다.
from 과 where 사이에는 테이블 이름만 쓰셔야 합니다.
답변을 작성하시기 전에 로그인 해주세요.