common.php 활용 디비연결

common.php 활용 디비연결

QA

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)) {

 

이런 단계로 처리하셔야 합니다.

 

이거 받아서 참고해보세요.

https://gnustudy.com/bbs/board.php?bo_table=gnu_pds&wr_id=112

답변을 작성하시기 전에 로그인 해주세요.
전체 59,609
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT