In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to obtain all the tables in the MySQL database in PHP. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
How does PHP get all the tables in the MySQL database
The code is as follows:
Functionlist_tables ($database) {$rs=mysql_list_tables ($database); $tables=array (); while ($row=mysql_fetch_row ($rs)) {$tables [] = $row [0];} mysql_free_result ($rs); return$tables;}
However, because the mysql_list_tables method is out of date, you will be prompted when you run the above program that the method is out of date, as follows:
The copy code is as follows:
Deprecated:Functionmysql_list_tables () isdeprecatedin... Onlinexxx
One way to deal with this is to set up error_reporting in php.ini without displaying method outdated prompts.
How does PHP get all the tables in the MySQL database
The copy code is as follows:
Error_reporting=E_ALL&~E_NOTICE&~E_DEPRECATED
Another way is to use the alternative officially recommended by PHP:
The copy code is as follows:
Functionlist_tables ($database) {$rs=mysql_query ("SHOWTABLESFROM$database"); $tables=array (); while ($row=mysql_fetch_row ($rs)) {$tables [] = $row [0];} mysql_free_result ($rs); return$tables;}
On how to get all the tables in the MySQL database in PHP is shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.