Forum Moderators: open
The problem is that php code chooses the table according to some data, thus the table to be queried will differ from time to time so to make 1 consistent query I have to use * (Rather than naming every column which can be different).
The problem is that 1 of the fields appears in all tables with the same name and it is a field I don't want, so I am wondering, how can I exclude that field from the query?
For example
$query = 'SELECT * FROM '.$tableName.' WHERE condition';
$tableName above will be different from query to query
The only way I see to do that is do a query to retrieve all the dynamic table column names to be included and then another query to create the view (Which would be querying the exact same table again) which sounds a bit too much.