'테이블 이름 불러오는 함수'에 해당되는 글 1건

MySQL 테이블 이름 불러오는 함수 mysql_tablename ()  DB 관련 함수

 

테이블 이름을 불러오는 함수로 mysql_table(인자1,인자2)가 있다.

 

인자1에 쿼리문 2에 변수를 넣는다.

 

사용법 :

 

<?php
mysql_connect("localhost", "root", "apmsetup");
$result = mysql_list_tables("hello");
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
    echo "Table: ", mysql_tablename($result, $i), "\n";
}

mysql_free_result($result);
?>

블로그 이미지

itworldkorea

IT korea가 세상(world)을 변화시킨다.

,