note 106451 added to function.mysql-query

From: Date: Thu, 10 Nov 2011 12:50:50 +0000
Subject: note 106451 added to function.mysql-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-184371@lists.php.net to get a copy of this message
Here's a quick way of getting the names of the tables in the current database: // select a database mysql_select_db("mydatabase"); // execute the query $tables = mysql_query("SHOW TABLES"); // Create an array to store the table names $tablelist = array(); // Go through each result and store it in the array while($fetchtables = mysql_fetch_array($tables)) { $tablelist[] = $fetchtables[0]; } // This array now contains all tables print_r($tablelist); ---- Server IP: 69.147.83.197 Probable Submitter: 84.25.166.153 ---- Manual Page -- http://www.php.net/manual/en/function.mysql-query.php Edit -- https://master.php.net/note/edit/106451 Del: integrated -- https://master.php.net/note/delete/106451/integrated Del: useless -- https://master.php.net/note/delete/106451/useless Del: bad code -- https://master.php.net/note/delete/106451/bad+code Del: spam -- https://master.php.net/note/delete/106451/spam Del: non-english -- https://master.php.net/note/delete/106451/non-english Del: in docs -- https://master.php.net/note/delete/106451/in+docs Del: other reasons-- https://master.php.net/note/delete/106451 Reject -- https://master.php.net/note/reject/106451 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184371) next »