게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
php고수분들 도와주세요
게시물ID : jisik_78042짧은주소 복사하기
작성자 : 강두
추천 : 0
조회수 : 427회
댓글수 : 2개
등록시간 : 2010/06/02 21:42:16
<?

$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>

위 소스는 게시판리스트에서 특정한 글을 클릭했을때 그 글의 내용을 보여주는

read.php 라는 파일의 소스인데요 

$sql="select * from phpboard  where num=$num";

이부분에서 $num 이라는 변수가 쿼리를 날려주기전에

먼저 선언되어서 자꾸 오류가나거든요

그러니까 $num이라는 변수가 의미하는게

제가 클릭한 게시물의 번호를 뜻하는건데

$num변수를 어떤식으로 선언해줘야 오류가안날지 모르겠습니다

도움좀 부탁드릴께요...
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호