where('type', $type)->where('status', '1')->select(); foreach ($query as $row) { $cert .= ''; } echo $cert ?: '';