Measure the test taker's understanding about the function of PHP to obtain database table information.

Source: Internet
Author: User

When we use

Mysql_list_dbs () function for PHP to obtain database table information ()

Resource mysql_list_dbs ([resource link_id])
Obtain the names of all databases on the server.

Example:

  1. Mysql_connect ("localhost", "name", "pwd ");
  2. $ Dbs = mysql_list_dbs ();
  3. While (list ($ db) = mysql_fetch_row (dbs )){
  4. Echo "$ db<Br>";
  5. }

Note that the output result is related to the user permissions used.

Mysql_db_name ()

String mysql_db_name (resource result_set, interger index)
Obtain the database name whose position is index in result_set returned by mysql_list_dbs.

Mysql_list_tables ()

Resource mysql_list_tables (string database [, resource link_id])
Obtain the names of all tables in the database.

Mysql_tablename ()

String mysql_tablename (resource result_set, interger index)
Obtain the index table name in result_set returned by mysql_list_tables.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.