Jump to content

[SOLVED] farfetched variable question


envexlabs

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.