Esempio n. 1
0
 /**
  * 插入一条记录
  * @para $data as array
  * return insert_id
  */
 public static function insertRow($data)
 {
     self::initDB();
     $sql = array2sql($data);
     $sql = "INSERT INTO `" . self::$table . "` SET " . $sql;
     $query = self::$dbConn->query($sql);
     if ($query) {
         $insertId = self::$dbConn->insert_id();
         return $insertId;
     } else {
         self::$errCode = "003";
         self::$errMsg = "error";
         return false;
     }
 }