I need to perform ‘n’ unions using mysqli (where n changes based on user input). For instance:
select a from b where a=c[1]
UNION
select a from b where a=c[2]
...
UNION
select a from b where a=c[n]
Is there anyway to do this iteratively? Something like that:
for(i=1;i
Note: I can only run select queries on the database
No need for union
For numeric
ait would befor strings idea is pretty the same.