mysql_tablename

(PHP 3, PHP 4 , PHP 5)

mysql_tablename -- 필드의 테이블이름을 얻음

설명

string mysql_tablename ( int result, int i)

mysql_tablename() 함수는 인자로 mysql_list_tables() 함수로 반환되는 결과 포인터와 동시에 테이블이름을 반환하고 정수형 인덱스를 가진다. mysql_num_rows() 함수는 결과 포인터에서 테이블 개수를 얻는데 사용된다.

예 1. mysql_tablename() 예제

<?php
mysql_connect
("localhost:3306");
$result = mysql_list_tables ("wisconsin");
$i = 0;
while (
$i < mysql_num_rows ($result)) {
    
$tb_names[$i] = mysql_tablename ($result, $i);
    echo
$tb_names[$i] . "<BR>";
    
$i++;
}
?>