queryStart example

return $stmt;
    }

    /** * Leave autocommit mode and begin a transaction. * * @return Zend_Db_Adapter_Abstract */
    public function beginTransaction()
    {
        $this->_connect();
        $q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION);
        $this->_beginTransaction();
        $this->_profiler->queryEnd($q);

        return $this;
    }

    /** * Commit a transaction and return to autocommit mode. * * @return Zend_Db_Adapter_Abstract */
    

    public function __construct($adapter$sql)
    {
        $this->_adapter = $adapter;
        if ($sql instanceof Zend_Db_Select) {
            $sql = $sql->assemble();
        }
        $this->_parseParameters($sql);
        $this->_prepare($sql);

        $this->_queryId = $this->_adapter->getProfiler()->queryStart($sql);
    }

    /** * Internal method called by abstract statment constructor to setup * the driver level statement * * @return void */
    protected function _prepare($sql)
    {
        return;
    }


        // check the PDO driver is available         if (!in_array($this->_pdoType, PDO::getAvailableDrivers())) {
            /** * @see Zend_Db_Adapter_Exception */
            throw new Zend_Db_Adapter_Exception('The ' . $this->_pdoType . ' driver is not currently installed');
        }

        // create PDO connection         $q = $this->_profiler->queryStart('connect', Zend_Db_Profiler::CONNECT);

        // add the persistence flag if we find it in our config array         if (isset($this->_config['persistent']) && ($this->_config['persistent'] == true)) {
            $this->_config['driver_options'][PDO::ATTR_PERSISTENT] = true;
        }

        try {
            $this->_connection = new PDO(
                $dsn,
                $this->_config['username'],
                $this->_config['password'],
                
Home | Imprint | This part of the site doesn't use cookies.