드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
게시물ID : jisik_77981짧은주소 복사하기
작성자 : 강두★
추천 : 1
조회수 : 469회
댓글수 : 3개
등록시간 : 2010/06/02 02:07:54
php로 게시판제작중인데
자꾸 여기서 막히네요...
게시판 목록에서 보고싶은 글을 클릭했을때 그 글의 내용을 보여주는
소스인데
자꾸 오류가뜹니다
제생각에는
$sql="select * from phpboard where num=$num";
이부분에서 게시판번호변수$num 를 인식하지못하는것같은데
혹시하고 제가 $num대신에 9로 수정해봤더니
오류가 안뜨고 9번게시물의 내용이 나오더군요...
따로 소스에 변화를주어야하는 부분이 존재하는지 도움좀 부탁드리겠습니다ㅠ
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\APM_Setup\htdocs\read.php on line 9
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\APM_Setup\htdocs\read.php on line 10
이건 오류내용이고 아래는 소스입니다
<?
$con=mysql_connect("localhost","root","123");
$db=mysql_select_db("sbcsi",$con);
$sql="select * from phpboard where num=$num";
$result=mysql_query($sql,$con);
$numrows=mysql_num_rows($result);
$rows=mysql_fetch_array($result);
$num=$rows[num];
$name=$rows[name];
$subject=$rows[subject];
$content=nl2br(htmlspecialchars($rows[content]));
?>
<html>
<head>
<title>red</title>
</head>
<body>
<table border=1 align=center width=680>
<tr>
<td width=80>num</td><td width=600><?=$num?></td>
</tr>
<tr>
<td width=80>name</td><td width=600><?=$name?></td>
</tr>
<tr>
<td width=80>subject</td><td width=600><?=$subject?></td>
</tr>
<tr>
<td width=80>content</td><td width=600><?=$content?></td>
</tr>
</table>
<center><a href="list.php">list</a></center>
</body>
</html>
댓글 분란 또는 분쟁 때문에
전체 댓글이 블라인드 처리되었습니다.
새로운 댓글이 없습니다.