execute() public method

Executes the SQL statement in the context of this connection.
public execute ( string $sql, mixed $arg1 = null, string $arg2 = null )
$sql string
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
コード例 #1
0
ファイル: SqlTest.php プロジェクト: jubinpatel/horde
 public function setUp()
 {
     $GLOBALS['injector'] = $this->getInjector();
     $factory = new Passwd_Factory_Driver($this->getInjector());
     $factory->backends = array();
     // Get a Horde_Db_Adapter to prevent usage of Horde_Core_Factory_Db.
     $db = new Horde_Db_Adapter_Pdo_Sqlite(array('dbname' => ':memory:'));
     $db->execute("CREATE TABLE horde_users (\n            user_uid VARCHAR(255) PRIMARY KEY NOT NULL,\n            user_pass VARCHAR(255) NOT NULL,\n            user_soft_expiration_date INTEGER,\n            user_hard_expiration_date INTEGER\n        );");
     $this->driver = new Passwd_Driver_Sql(array('db' => $db));
 }