示例#1
0
 /**
  * Insert data
  * @param $data
  * @param $table
  * @return mixed
  */
 protected function _insert($data, $table)
 {
     $result = $this->_multiInsert(array($data), $table);
     if ($result) {
         return $this->_db->insertid();
     }
     return 0;
 }
示例#2
0
 /**
  * Returns the ID generated from the previous insert operation
  *
  * @return int
  */
 public function insertid()
 {
     return $this->db->insertid();
 }
示例#3
0
 /**
  * Test the JDatabaseMySQLi::query() method
  *
  * @return  void
  *
  * @since   11.4
  */
 public function testQuery()
 {
     $this->object->setQuery("REPLACE INTO `jos_dbtest` SET `id` = 5, `title` = 'testTitle'");
     $this->assertThat($this->object->query(), $this->isTrue(), __LINE__);
     $this->assertThat($this->object->insertid(), $this->equalTo(5), __LINE__);
 }