query() public méthode

Wrapper to execute a query
public query ( string $query ) : boolean
$query string query to run
Résultat boolean
 /**
  * test select one
  */
 public function test_select_one()
 {
     $table = $this->adapter->create_table('users');
     $table->column('name', 'string', array('limit' => 20));
     $table->column('age', 'integer');
     $table->finish();
     $id1 = $this->adapter->query(sprintf("INSERT INTO users (name, age) VALUES ('%s', %d) RETURNING \"id\"", 'Taco', 32));
     $this->assertEquals(1, $id1);
     $result = $this->adapter->select_one(sprintf("SELECT * FROM users WHERE name = '%s'", 'Taco'));
     $this->assertEquals(true, is_array($result));
     $this->assertEquals('Taco', $result['name']);
     $this->assertEquals(32, $result['age']);
     $this->drop_table('users');
 }
 /**
  * Execute a query
  *
  * @param string $sql the query to run
  *
  * @return boolean
  */
 public function query($sql)
 {
     return $this->_adapter->query($sql);
 }