각 게시물 최근댓글 제목옆에 호출하기 질문이요 정보
각 게시물 최근댓글 제목옆에 호출하기 질문이요본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 :
view.php 에서는
<?
$result = mysql_query("select wr_content from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_id desc limit 1");
$row = mysql_fetch_row($result);
echo $row[0];
?>
이렇게 해서 제목옆에 호출했고요
list.php에서는
<?
$result = mysql_query("select wr_content from $write_table where wr_parent = '{$list[$i]['wr_id']}' and wr_is_comment = 1 order by wr_id desc limit 1");
$row = mysql_fetch_row($result);
echo $row[0];
?>
이렇게 해서 제목옆에 호출했는데요
latest.skin.php에서도 list.php 처럼 삽입해서 호출하려 했는데
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /localhost/skin/latest/basic/latest.skin.php on line 45
라고 에러메세지가 나옵니다.
최신글 게시판이나 리스트 게시판이나 다를게 없다고 생각했는데 latest.php에서는 호출값이 없는걸로 나오는건지요...
오류 주소 :
view.php 에서는
<?
$result = mysql_query("select wr_content from $write_table where wr_parent = '$wr_id' and wr_is_comment = 1 order by wr_id desc limit 1");
$row = mysql_fetch_row($result);
echo $row[0];
?>
이렇게 해서 제목옆에 호출했고요
list.php에서는
<?
$result = mysql_query("select wr_content from $write_table where wr_parent = '{$list[$i]['wr_id']}' and wr_is_comment = 1 order by wr_id desc limit 1");
$row = mysql_fetch_row($result);
echo $row[0];
?>
이렇게 해서 제목옆에 호출했는데요
latest.skin.php에서도 list.php 처럼 삽입해서 호출하려 했는데
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /localhost/skin/latest/basic/latest.skin.php on line 45
라고 에러메세지가 나옵니다.
최신글 게시판이나 리스트 게시판이나 다를게 없다고 생각했는데 latest.php에서는 호출값이 없는걸로 나오는건지요...
댓글 전체
mysql_fetch_row() 앞에다가 @ 를 쓰시면 오류 메시지 막을수 있구요
저라면 요렇게 사용할거 같습니다.
$query = mysql_query("select wr_content from $write_table where wr_parent = '{$list[$i]['wr_id']}' and wr_is_comment = 1 order by wr_id desc limit 1");
$result = mysql_query ($query); // 글 꺼내기
while ($data = mysql_fetch_array ($result)) {
//요런식으로 쓰면 $data 안에 배열로 나와 사용 가능
// 변수 확인
print_r2($data);
}
저는 요런식으로 쓰는게 편하더라구요
저라면 요렇게 사용할거 같습니다.
$query = mysql_query("select wr_content from $write_table where wr_parent = '{$list[$i]['wr_id']}' and wr_is_comment = 1 order by wr_id desc limit 1");
$result = mysql_query ($query); // 글 꺼내기
while ($data = mysql_fetch_array ($result)) {
//요런식으로 쓰면 $data 안에 배열로 나와 사용 가능
// 변수 확인
print_r2($data);
}
저는 요런식으로 쓰는게 편하더라구요
Warning: mysql_fetch_row(): supplied argument is not a valid
는 mysql_fetch_row() 함수가 쿼리를 실행 했을 때 쿼리문 오류로 값을 읽어올 수 없는 경우 입니다.
latest.skin.php 와 list.php와는 쓰는 방법이 다릅니다. ^^
혹시 latest skin 이 basic 이시면
(1) /lib/latest.lib.php에서
select~~ 하고요
(2) /skin/latest/basic/latest.skin.php 에서 출력합니다.
latest.skin.php 에 {$list[$i]['content']} 만 넣으면 될듯하네여~~
는 mysql_fetch_row() 함수가 쿼리를 실행 했을 때 쿼리문 오류로 값을 읽어올 수 없는 경우 입니다.
latest.skin.php 와 list.php와는 쓰는 방법이 다릅니다. ^^
혹시 latest skin 이 basic 이시면
(1) /lib/latest.lib.php에서
select~~ 하고요
(2) /skin/latest/basic/latest.skin.php 에서 출력합니다.
latest.skin.php 에 {$list[$i]['content']} 만 넣으면 될듯하네여~~
다케미카코님 말씀대로 해봐도 같은 에러문이 나오고요 @를 붙이면 아무것도 호출이 되질 않습니다. 웹이지님 말씀처럼 셀렉트랑 호출을 따로따로 해야 될거 같은데 latest.lib.php에 제가 코딩한대로 삽입을 해보고 latest.skin.php에서 호출도 해 봤지만 나오질 않네요 ㅠㅠ 좀 더 자세히 알려 주실수 있을까요?