mysql 질문..

· 21년 전 · 356 · 2
gb_write_gallery2_file 테이블과 gb_write_gallery2 테이블에서..
wr_id 값이 같은 값을 뽑을 려고 합니다. 쿼리문 좀 가르켜 주세요.
(예를 들어서 wr_id 가 8인 두 테이블의 값을 다 출력하고자 할 때)
아래와 같이 하니깐

SELECT * FROM gb_write_gallery2_file, gb_write_gallery2 WHERE wr_id = 8

#1109 - Unknown table 'gb_write_gallery' in where clause
이런 에러메시지를 출력하네요???
|

댓글 2개

근데.. 아직 wr_id 가 안 먹히는 군요..
내용부분은 잘 불러오는데.. 이미지가 다 출력됩니다..
어찌 해결해야 할지...
wr_id 에 검색된 이미지만 불러올 수는 없는지요??
그냥 이렇게 해결했습니다. ^^; 어찌꺼나 되니까 기쁩니다. 혼자 해결했다는 이 기쁨.. ㅋㅋ

<?
function get_thumb_filename10($num, $seq) {
return sprintf("%05d", $num) . "_" . sprintf("%03d", $seq);
}

function get_saved_filename($cont) {
$swrd = "/\.(jpg|png|gif|bmp)$/i";
return preg_replace($swrd, "", $cont);
}

if($wr_id) $wh = "where wr_id = '{$wr_id}' ";
if($cap == 'y') {
$file_table1 = "gb_write_{$bo_table}";
$file_table2 = "gb_write_{$bo_table}_file";

$sql1 = " select wr_id, wr_file1, wr_file2, wr_content, wr_subject from $file_table1 $wh "; // 답사기스킨 wr_file1, wr_file2 불러오기
$sql2 = " select * from $file_table2 $wh "; // 답사기스킨 추가파일 불러오기
$result1 = sql_query($sql1);
$result2 = sql_query($sql2);
while($row=mysql_fetch_array($result1)) {
$cont_tmp = cut_str(get_text($row['wr_content']), $cap_len, "");
if($row['wr_file1']) {
$file_cap_cont = get_saved_filename($row['wr_file1']);
${$file_cap_cont} = preg_replace("/(\r\n|\n)/i", "<br>", $cont_tmp);
}
if($row['wr_file2']) {
$file_cap_cont = get_saved_filename($row['wr_file2']);
${$file_cap_cont} = preg_replace("/(\r\n|\n)/i", "<br>", $cont_tmp);
}
}
while($row=mysql_fetch_array($result2)) {
$file_cap_cont = get_thumb_filename10($row['wr_id'], $row['wf_id']);
${$file_cap_cont} = preg_replace("/(\r\n|\n)/i", "<br>", cut_str(get_text($row[wf_cont]), $cap_len, ""));
}
}
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
21년 전 조회 390
21년 전 조회 309
21년 전 조회 465
21년 전 조회 304
21년 전 조회 387
21년 전 조회 414
21년 전 조회 665
21년 전 조회 329
21년 전 조회 419
21년 전 조회 357
21년 전 조회 460
21년 전 조회 504
21년 전 조회 776
21년 전 조회 380
21년 전 조회 307
21년 전 조회 537
21년 전 조회 442
21년 전 조회 517
21년 전 조회 532
21년 전 조회 447
🐛 버그신고