Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $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) {
- $getSQL = "Select *, '".$table ."' as dep From ".$table." where `lang` = '".$lang."' and `chk` = 'Y'";
- } else {
- $getSQL .= " Union Select *, '".$table ."' as dep From ".$table." where `lang` = '".$lang."' and `chk` = 'Y'";
- }
- }
- $getSQL .= " order by dep, year, sortIndex, title";
- $getSQL = "Select id from ".$tables[0]." where 1=0";
- foreach ($tables as $key => $table) {
- $getSQL .= " Union Select *, '".$table ."' as dep From ".$table." where `lang` = '".$lang."' and `chk` = 'Y'";
- }
- $getSQL .= " order by dep, year, sortIndex, title";
Add Comment
Please, Sign In to add comment