- if ($db === null) {
- $db =& DB::connect('mysql://mark:mark@intranet-db.mecon.ar/MEconDAV',
- array('persistent' => true));
- }
- if (DB::isError($db)) {
- return $db;
- }
- return $db->getAssoc('
- SELECT S.section_id, S.description
- FROM MEconDAV.Sections as S
- ORDER BY description');
+ static $conf;
+ if (!$conf) {
+ $conf = parse_ini_file(AI_GRUPOSECCIONES_CONFFILE, true);
+ $conf = $conf['mecondav'];
+ }
+ extract($conf);
+ return $db->getAssoc("
+ SELECT $id, $campo
+ FROM $base.$tabla
+ ORDER BY $campo ASC");