|
|
|
|
![]() ![]() |
Dec 17 2005, 04:04 AM
Post
#1
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 195 Joined: 18-November 05 Member No.: 14,521 |
hello again guys!, i was wondering if there is a way to get the table names from my database using php. Well what i want to do is to get the name of the tables returned as an array or something similar...
thanx in advance |
|
|
|
Dec 17 2005, 11:22 AM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,153 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
You can use an SQL command to list all of the table names in a database.
For example: CODE <?php mysql_connect(localhost,username,password); $query = "SHOW TABLES FROM database"; $tables = mysql_query($query); ?> The variable $tables will then contain all of the names of the tables. Hope this helps you. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 07:30 AM |