Example #1
0
 /**
  *
  * @param array $data
  * @return integer 最后插入的主键id
  */
 public function insert($data)
 {
     $data = $this->mysql_escape_data($data);
     $data_values = $this->parse_data($data);
     $sql = 'INSERT INTO ' . $this->_table . ' SET ' . $data_values;
     $dbh = $this->_db->prepare($sql);
     $dbh->execute();
     return $this->_db->lastInsertId();
 }
Example #2
0
 /**
  * 插入最后插入的记录ID
  */
 public function lastInsertId()
 {
     return $this->connectionWrite->lastInsertId();
 }
Example #3
0
 /**
  * 返回当前新增ID
  *
  * @return number
  */
 public function getId($sql = null)
 {
     return $this->_linkID->lastInsertId();
 }