/** * 执行插入 * * @return Statement * * @throws \Exception */ public function execute() { $query = $this->compile(); $return = $this->connection->query($query['sql'], $query['arguments']); $this->insertRow = array(); return $return; }
/** * 执行创建操作 * * @return Statement * * @throws Monkey\Exceptions\Sql\SqlEmptyException */ public function execute() { $sql = $this->getSql(); if (!$sql) { new Monkey\Exceptions\Sql\SqlEmptyException('sql语句为空,创建数据库表失败', 1024); } return $this->connection->query($sql); }
/** * 执行事务query */ protected function pop() { foreach (array_reverse($this->pdoTrans) as $name => $active) { if ($active) { break; } unset($this->pdoTrans[$name]); if (empty($this->pdoTrans)) { if (!$this->conn->commit()) { throw new \Exception('commit failed.'); } } else { $this->conn->query('RELEASE SAVEPOINT ' . $name); } } }
/** * 执行查询 * * @return Statement */ public function execute() { return $this->connection->query($this->getString(), $this->getArguments()); }
/** * 执行更新 * * @return Statement */ public function execute() { $query = $this->compile(); return $this->connection->query($query['sql'], $query['arguments']); }