本文实例讲述了PHP列出@R_403_198@中所有数据库的方法。分享给大家供大家参考。具体如下:
PHP;">
PHP
define( 'NL',"\n" );
define( 'TB',' ' );
// connecting to @R_403_198@.
$conn = @@R_403_198@_connect( 'localhost','username','password' )
or die( @R_403_198@_errno().': '.@R_403_198@_error().NL );
// attempt to get a list of @R_403_198@ databases
// already set up in my account. This is done
// using the PHP function: @R_403_198@_list_dbs()
$result = @R_403_198@_list_dbs( $conn );
// Output the list
echo '
- 403_198@_fetch_object()
// ---------------------------
while( $row = @R_403_198@_fetch_object( $result ) ):
echo TB.'
- '.$row->Database.' '.NL; endwhile; //*/ /* USING: @R_403_198@_fetch_row() // ------------------------ while( $row = @R_403_198@_fetch_row( $result ) ): echo TB.'
- '.$row[0].' '.NL; endwhile; //*/ /* USING: @R_403_198@_fetch_assoc() // -------------------------- while( $row = @R_403_198@_fetch_assoc( $result ) ): echo TB.'
- '.$row['Database'].' '.NL; endwhile; //*/ echo '
希望本文所述对大家的PHP程序设计有所帮助。