php mysql tutorial to get all the specified database table name If you want to display mysql a specified database table name is very simple, mysql provides a show tables command, it returns a data, let me look at the detailed examples, Tested is fully available * /
function get_tables () / / Get all the table name { $ tables = array (); $ r = fetch_all ("show tables"); foreach ($ r as $ v) { foreach ($ v as $ v_) { $ tables [] = $ v_; } } return $ tables; }
function fetch_all ($ sql) { $ rs = mysql_query ($ sql); $ result = array (); while ($ rows = mysql_fetch_array ($ rs, mysql_assoc)) { $ result [] = $ rows; }
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.