MysqliDb::unlock PHP Method

unlock() public method

Also commits transactions.
Author: Jonas Barascu
public unlock ( ) : MysqliDb
return MysqliDb
    public function unlock()
    {
        // Build the query
        $this->_query = "UNLOCK TABLES";
        // Exceute the query unprepared because UNLOCK and LOCK only works with unprepared statements.
        $result = $this->queryUnprepared($this->_query);
        $errno = $this->mysqli()->errno;
        // Reset the query
        $this->reset();
        // Are there rows modified?
        if ($result) {
            // return self
            return $this;
        } else {
            throw new Exception("Unlocking of tables failed", $errno);
        }
        // Return self
        return $this;
    }