envexlabs Posted June 25, 2007 Share Posted June 25, 2007 alright, i have my function: function select_table($table_id, $table_name){ $store_id = mysql_escape_string($store_id); $store_info_query = mysql_query('SELECT * FROM `store` WHERE ID = ' . $store_id . ''); $store_info = mysql_fetch_row($store_info_query); return $store_info; } i want to be able to use this for selecting any table, but i will be selecting multiple tables on one page. this means that there would be multiple $store_info arrays, thus making the page not work. is there a way to use the $table_name variable to create a dynamic $($table_name)_info variable? i hope this isn't just some random ramblings! Link to comment https://forums.phpfreaks.com/topic/57081-solved-farfetched-variable-question/ Share on other sites More sharing options...
envexlabs Posted June 25, 2007 Author Share Posted June 25, 2007 i figured it out! ${ $table_name } Link to comment https://forums.phpfreaks.com/topic/57081-solved-farfetched-variable-question/#findComment-282081 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.