I have a query
$STH_1 = $DBH_R->query("SELECT table_name
FROM information_schema.tables
WHERE table_name
LIKE 'v_c_ei\_9%'
");
$stmts_1 = array();
while (($row_1 = $STH_1 -> fetch_assoc()) !== null){
$table_name = $row_1['table_name'];
The result of this query is, generally, the list of the tables in order:
v_c_ei_9001
v_c_ei_9002
...........
v_c_ei_9030
In another table, v_c_country
, I have 2 columns: table_name
and country_name
,
(because for example, v_ei_c_9001
is Australia
, v_ei_c_9012
is Great Britain
etc.)
Generally, as the result, I need the list of the tables (table names) from query above but in ORDER ASC from country names from table v_c_country
.
How to change the query?