0
This is how I union a query. All of the tables are in same structure.
$prefix = "dev_";
$tables = [$prefix."pp", $prefix."pe", $prefix."chem", $prefix."fiber", $prefix."plastic", $prefix."qc", $prefix."cac", $prefix."electron"];
$getSQL = '';
foreach ($tables as $key => $table) {
if (!$getSQL...