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! 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]}"); 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
Archived
This topic is now archived and is closed to further replies.