In my application I want use dynamic table name.
In my application I have two queries.
1) SELECT `table_name` FROM `data_tables` WHERE `table_id`="1"
From this query I get a table name and I am saving it in a variable; for e.g: $tab
I have another query:
2) SELECT * FROM `'.$tab.'`;
I want to know is there anyway to club these queries? Is it a good practice?
My application is currently working fine, but I would like some insight.