데이터베이스/SQL
[MySQL API] mysql_list_dbs()
광박이
2011. 3. 3. 14:32
728x90
MySQL 서버에 존재하는 데이터베이스 목록
【예제】
<html><body>
< ?
$con=mysql_connect("localhost","root","root_password");
$show_db=mysql_list_dbs($con);
$num_row=mysql_num_rows($show_db);
for($i=0; $i < $num_row; $i++) {
$db=mysql_result($show_db, $i,0);
echo "$db <br>";
}
? >
</body></html>
【예제】
<html><body>
< ?
$con=mysql_connect("localhost","root","root_password");
$show_db=mysql_list_dbs($con);
$num_row=mysql_num_rows($show_db);
for($i=0; $i < $num_row; $i++) {
$db=mysql_result($show_db, $i,0);
echo "$db <br>";
}
? >
</body></html>
728x90