{$r['index']}"; } else { $html .= ""; } } echo $html; } if ($cmd == "viewOnly") { $table = 'misc'; $sql = "SELECT uniqueitems.`index`, uniqueitems.`code`, misc.`type` FROM uniqueitems LEFT JOIN misc ON uniqueitems.`code` = misc.`code` WHERE `type` IS NOT NULL AND uniqueitems.`code`='$view'"; if ($view == 'armo') { $table = 'armor'; $sql = "SELECT uniqueitems.`index`, uniqueitems.`code`, $table.`code` FROM uniqueitems LEFT JOIN $table ON uniqueitems.`code` = $table.`code` WHERE `type` IS NOT NULL AND uniqueitems.`code`= $table.`code` AND $table.`code` != '' ORDER BY `index`"; } if ($view == 'weap') { $table = 'weapons'; $sql = "SELECT uniqueitems.`index`, uniqueitems.`code`, $table.`code` FROM uniqueitems LEFT JOIN $table ON uniqueitems.`code` = $table.`code` WHERE `type` IS NOT NULL AND uniqueitems.`code`= $table.`code` AND $table.`code` != '' ORDER BY `index`"; } if ($view == "char") { $sql .= " OR uniqueitems.`code`='cm1' OR uniqueitems.`code`='cm2' OR uniqueitems.`code`='cm3'"; } $res = PDO_FetchAll($sql); $html = ''; foreach ($res as $r) { if ($sort == 'index') { $html .= ""; } else { $html .= ""; } } echo $html; }