Пример #1
0
 function __construct($arr = null)
 {
     C::sessionStart();
     //$pageXML = (C::isLocal())?C::getOutsidePath().'aj-db/aj_hfut_page.xml':C::getOutsidePath().'cgi-bin/aj_hfut_page.xml';
     $pageXML = C::isLocal() ? 'config/aj_hfut_page.xml' : 'config/aj_hfut_page.xml';
     $this->xml = simplexml_load_file($pageXML);
     $this->url = C::isLocal() ? $this->xml->config->url['local'] : $this->xml->config->url['server'];
     $this->dbc = C::connect();
     $this->arr = isset($arr) ? $arr : null;
     $this->table = "aj_tumu_users";
 }
Пример #2
0
 public function insertIntoSQL($name, $content)
 {
     global $config;
     $table = C::isLocal() ? $config['message']['local_table'] : $config['message']['table'];
     $query = sprintf("INSERT INTO %s (message_name,message_content)VALUES\n\t\t\t\t\t\t('%s','%s')", $table, $name, $content);
     if (C::query($query, $this->dbc)) {
         return array('isok' => '1', 'info' => '');
     } else {
         return array('isok' => '0', 'info' => $table . '--' . $query . '--' . mysql_error($this->dbc), 'info2' => $this->dbc);
     }
 }