Jump to content
xisto Community
Sign in to follow this  
spy_charly

An Sql Problem In Php returnin the name of the tables

Recommended Posts

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

Share this post


Link to post
Share on other sites

You can use an SQL command to list all of the table names in a database.

For example:

<?phpmysql_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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.