PHP mysql_field_table() 함수
정의 및 사용법
mysql_field_table() 함수는 지정된 필드가 있는 테이블 이름을 반환합니다.
성공하면 지정된 필드의 테이블 이름을 반환하고, 실패하면 false를 반환합니다.
문법
mysql_field_table(data,field_offset)
파라미터 | 설명 |
---|---|
data | 必需. 사용할 데이터 포인터. 이 데이터 포인터는 mysql_query() 반환 결과. |
field_offset | 必需. 반환 시작 필드를 지정합니다. 0은 첫 번째 필드을 의미합니다. |
예제
<?php $con = mysql_connect("localhost", "hello", "321"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("test_db",$con); $sql = "SELECT * from Person"; $result = mysql_query($sql,$con); $table = mysql_field_table($result, 0); echo $table; mysql_close($con); ?>
출력:
인물