common.php 활용 디비연결
본문
안녕하세요.
아래는 회원정보를 뽑아오는 페이지를 만들려고 합니다.
바로 디비연결을 사용하지 않고 common.php 파일을 호출하요 만들려고 합니다. '
좀 수정하였더니 페이지가 열리지 않습니다.
어디가 잘못된것일까 수정 부탁드립니다.
감사합니다.
<?
//include "lib.php";
include_once('./_common.php');
?>
<table width=800 border="1" >
<tr>
<th width=50 > No </th>
<th> 제목 </th>
<th width=100> 작성자 </th>
<th width=90 > 작성일자 </th>
</tr>
<?
$query = "select * from g5_member order by mb_no desc ";
// $result = mysqli_query($connect, $query);
//$data = sql_fetch($query);
// while($data = mysqli_fetch_array($result)){
while($data = sql_fetch($query)) {
?>
<tr>
<td> <?=$data[mb_no]?> </td>
<td> <a href="view.php?mb_no=<?=$data[mb_no]?>"><?=$data[mb_nick]?></a> </td>
<td> </td>
<td></td>
<? } ?>
</table>
답변 2
회원정보를 내림차순으로 모두 불러오는 경우
그누보드에서는
$query =
$result = sql_query($query);
while ($row = sql_fetch_array($result)) {
이런 단계로 처리하셔야 합니다.