worldworld Posted February 26, 2007 Share Posted February 26, 2007 Is it possible to parametrize the table of a SELECT ? SELECT * FROM $1 # for example. Thank you for any hint or pointers! Quote Link to comment https://forums.phpfreaks.com/topic/40141-parametrize-the-table-of-a-select/ Share on other sites More sharing options...
skali Posted February 26, 2007 Share Posted February 26, 2007 Yes certainly you can. $table = 'users'; mysql_query("select * from $table"); Or in case of table array: $tables[0] = 'users'; $tables[1] = 'preferences'; $tables[2] = 'blahblah'; mysql_query("select * from {$table[index]}"); Quote Link to comment https://forums.phpfreaks.com/topic/40141-parametrize-the-table-of-a-select/#findComment-194218 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.