Last active
December 13, 2015 23:39
-
-
Save MaraScott/4992933 to your computer and use it in GitHub Desktop.
Name : filterTable - Language : Sql - type : Select - platform : geniric - tag : filter, table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Filter table from a database */ | |
/* see : http://stackoverflow.com/questions/6528531/mysql-show-tables-sort-by-table-name?answertab=votes#tab-top */ | |
/* string $filter = filter */ | |
/* string $dbn = database name */ | |
SELECT table_name | |
FROM information_schema.tables | |
WHERE table_type = 'BASE TABLE' AND table_schema='$dbn' AND table_name LIKE '$filter' | |
ORDER BY table_name ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment