묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
이 소스 어디가 잘못된것인지 보시고 가르쳐주세여.
2003.01.08 20:58
동주아빠님이 쓰신 강좌를 보고 만드는중인데.. 자꾸 오류가 나서여..
소스 내용은
<?
mysql_connect("localhost","디비아뒤","디비암호");
mysql_select_db("dirtyschool");
if($page=='')$page=1;
$list_num=10;
$page_num=10;
$offset=$list_num*($page-1);
$query="select count(*) from iboard";
$result=mysql_query($query);
$row=mysql_fetch_row($result);
$total_no=$row[0];
$total_page=ceil($total_no/$list_num);
$cur_num=$total_no-$list_num*($page-1);
$query="select * from $tablename order by number desc limit $offset, $list_num";
$result=mysql_query($query);
$array=mysql_fetch_array($result);
$date=date("y/m/d", $array[writetime]);
?>
<html>
<head>
</head>
<body>
<?
for($i=1;$i<=$list_num;$i++){
echo "
<table>
<tr>
<td>no</td>
<td>subject</td>
<td>name</td>
<td>date</td>
<td>read</td>
</tr>
<tr>
<td>$cur_num</td>
<td>$array[subject]</td>
<td>$array[name]</td>
<td>$date</td>
<td>$array[hit]</td>
</tr>
<tr>
<td colspan=5></td>
</tr>
</table>
";
}
?>
</body>
</html>
이구여. 오류 메세지가..
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home1/dirtyschool/public_html/iboard/list.php on line 21
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
이렇게 떠여.. 게시물을 검색해서 열로 저장하는부분이 잘못된거 같은데..
그리고 게시물 숫자번호도 안맞구여.. 게시물도 4개밖에 저장이 안되있는데 10번이나 반복이 되서..
보시고 답변좀 꼭 주세여~
소스 내용은
<?
mysql_connect("localhost","디비아뒤","디비암호");
mysql_select_db("dirtyschool");
if($page=='')$page=1;
$list_num=10;
$page_num=10;
$offset=$list_num*($page-1);
$query="select count(*) from iboard";
$result=mysql_query($query);
$row=mysql_fetch_row($result);
$total_no=$row[0];
$total_page=ceil($total_no/$list_num);
$cur_num=$total_no-$list_num*($page-1);
$query="select * from $tablename order by number desc limit $offset, $list_num";
$result=mysql_query($query);
$array=mysql_fetch_array($result);
$date=date("y/m/d", $array[writetime]);
?>
<html>
<head>
</head>
<body>
<?
for($i=1;$i<=$list_num;$i++){
echo "
<table>
<tr>
<td>no</td>
<td>subject</td>
<td>name</td>
<td>date</td>
<td>read</td>
</tr>
<tr>
<td>$cur_num</td>
<td>$array[subject]</td>
<td>$array[name]</td>
<td>$date</td>
<td>$array[hit]</td>
</tr>
<tr>
<td colspan=5></td>
</tr>
</table>
";
}
?>
</body>
</html>
이구여. 오류 메세지가..
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home1/dirtyschool/public_html/iboard/list.php on line 21
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
no subject name date read
11 70/01/01
이렇게 떠여.. 게시물을 검색해서 열로 저장하는부분이 잘못된거 같은데..
그리고 게시물 숫자번호도 안맞구여.. 게시물도 4개밖에 저장이 안되있는데 10번이나 반복이 되서..
보시고 답변좀 꼭 주세여~