国产女人18毛片水真多18精品, 一区二区三区中文字-亚洲精品女国产, 欧美熟妇老熟妇88888久久久久, 一级毛片免费观看亚洲欧美国产精品,大波霸美女视频,日韩欧美激情V影院,熟女人伦21p,亚洲精品女国产,国产 乱子伦 在线

PHP獲取MySQL數(shù)據(jù)庫(kù)里所有表的實(shí)現(xiàn)代碼

時(shí)間:2025-11-04 20:11:28 php語(yǔ)言

PHP獲取MySQL數(shù)據(jù)庫(kù)里所有表的實(shí)現(xiàn)代碼

  如何獲取某個(gè)MySQL數(shù)據(jù)庫(kù)中所有表的PHP代碼如下,需要的朋友可以參考下。跟隨小編去看看。

  代碼如下:

  function list_tables($database)

  {

  $rs = mysql_list_tables($database);

  $tables = array();

  while ($row = mysql_fetch_row($rs)) {

  $tables[] = $row[0];

  }

  mysql_free_result($rs);

  return $tables;

  }

  但由于mysql_list_tables方法已經(jīng)過(guò)時(shí),運(yùn)行以上程序時(shí)會(huì)給出方法過(guò)時(shí)的提示信息,如下:

  復(fù)制代碼 代碼如下:

  Deprecated: Function mysql_list_tables() is deprecated in … on line xxx

  一個(gè)處理辦法是在php.ini中設(shè)置error_reporting,不顯示方法過(guò)時(shí)提示信息

  復(fù)制代碼 代碼如下:

  error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

  另一個(gè)方法是使用PHP官方推薦的替代做法:

  復(fù)制代碼 代碼如下:

  function list_tables($database)

  {

  $rs = mysql_query("SHOW TABLES FROM $database");

  $tables = array();

  while ($row = mysql_fetch_row($rs)) {

  $tables[] = $row[0];

  }

  mysql_free_result($rs);

  return $tables;

  }

【PHP獲取MySQL數(shù)據(jù)庫(kù)里所有表的實(shí)現(xiàn)代碼】相關(guān)文章:

PHP讀取MySQL數(shù)據(jù)代碼方法02-20

PHP讀取MySQL數(shù)據(jù)的代碼方法02-16

php連接mysql數(shù)據(jù)庫(kù)代碼09-13

PHP向MySQL數(shù)據(jù)庫(kù)保存數(shù)據(jù)代碼03-21

php向Mysql數(shù)據(jù)庫(kù)保存數(shù)據(jù)的代碼08-26

PHP如何執(zhí)行MySql語(yǔ)句查詢(xún)獲得表內(nèi)所有數(shù)據(jù)12-13

php獲取json數(shù)據(jù)所有的節(jié)點(diǎn)路徑12-25

php獲取新浪微博數(shù)據(jù)API的實(shí)例代碼02-18

PHP 中 MySQL 數(shù)據(jù)庫(kù)異步查詢(xún)實(shí)現(xiàn)03-03