I have authentication system which gets permissions from MySQL database.
CREATE TEMPORARY TABLE db.temp (authority VARCHAR(100));
INSERT INTO db.temp (authority) SELECT blog.authors.id FROM db.authors;
UPDATE db.temp SET authority=CONCAT("AUTH_",authority);
SELECT authority FROM db.temp
UNION
SELECT authority FROM db.authorities_real
This script works fine when executed from command line, but in Views, use of temporary tables is not allowed. Is there any way to do what i want without them?
Why not just
UNIONusing theauthorstable:Instead of creating your temp table, you will just use the
db.authorstable in theUNION. Doing it this way you do not have to use a temp table.The
UNIONwill remove any duplicates from the query. If you don’t mind the duplicates or do not expect any then I would use aUNION ALL