데이터베이스/SQL
[MySQL API] mysql_list_tables()
광박이
2011. 3. 3. 14:35
728x90
인자로 주어진 데이터베이스 내에서 테이블 목록의 결과 포인터
【예제】
<html><body>
< ?
$con=mysql_connect("localhost","root","root_password");
$db=mysql_select_db("mydb",$con);
$result=mysql_list_tables("mydb",$con);
$row_num=mysql_num_rows($result);
for($i=0; $i < $row_num; $i++) {
$table=mysql_tablename($result, $i);
echo "$table <br>";
}
? >
</body></html>
【예제】
<html><body>
< ?
$con=mysql_connect("localhost","root","root_password");
$db=mysql_select_db("mydb",$con);
$result=mysql_list_tables("mydb",$con);
$row_num=mysql_num_rows($result);
for($i=0; $i < $row_num; $i++) {
$table=mysql_tablename($result, $i);
echo "$table <br>";
}
? >
</body></html>
728x90