Display mysql tables
Hello ninja programmers,
I have a database called "database" with tables:
Now I want to display say only table1,2,3 in my sidebar. Say like in wordpress dashboard, where it displays post, categories, etc.
But I dont want to display all of the tables. How do I achieve that?
Thanks for your help.
Interesting naming conventions. I would have reversed it, and called my database "table" and my tables "database#", but I'm cRAzEe.
How far have you gotten? If you're running this in WordPress, you can instantiate a new WPDB object to handle the database connection. After that it's just a matter of your query and method of displaying the results.
You can use a WHERE clause in a show tables statement, however you may be more interested in LIKE, ie
However this will just display a list of the table names, and with your naming conventions, will actually list all of them. You may want to consider using the information_schema database for this;
Brilliant. Much thanks :)
|All times are GMT. The time now is 08:46 PM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0