asp의 getrows를 php로 구현하기 방법

asp의 getrows를 php로 구현하기 방법

itggun 0 224 2019.08.23 12:28



<?php

$rootPath = $_SERVER["DOCUMENT_ROOT"]; // 루트 경로

$tb = "bbs_free"; // 자유게시판

include $rootPath . "/dbcon/dbopen.php"; // DB 연결

include $rootPath . "/include/function.php"; // 라이브러리 인클루드


$query = "select count(*) from $tb"; // 카운트

$rows = MyfetchRow($query, $connect);

echo $rows[0];



function mysql_getrows(&$conn,&$rs,$query){

$result=mysql_query($query,$conn);

$rs=array();

for($i=0,$j=mysql_num_rows($result);$i<$j;$i++){

mysql_data_seek($result,$i);

$rs[$i]=mysql_fetch_array($result);

}

}


$query = "select no, id, name, regdate from $tb order by no desc";

mysql_getrows($connect,$rs,$query);

mysql_close();


echo "<br>";

for($i=0,$j=count($rs);$i<$j;$i++){

echo('<td>'.$rs[$i][0].'<td>'.$rs[$i][1].$rs[$i][2].$rs[$i][3]."<br>");

}


?>

9ab42a85804b65581b44802a1197bf10_1569484085_82.jpg

 

Comments

State
  • 현재 접속자 1 명
  • 오늘 방문자 1 명
  • 어제 방문자 0 명
  • 최대 방문자 155 명
  • 전체 방문자 1,232 명
  • 전체 게시물 0 개
  • 전체 댓글수 0 개
  • 전체 회원수 2 명
Facebook Twitter GooglePlus KakaoStory NaverBand