Database::close PHP Method

close() public method

public close ( ) : boolean
return boolean
    public function close()
    {
        $this->isOpen = false;
        if ($this->conn) {
            $ret = $this->closeConn();
            $this->conn = null;
            return $ret;
        } else {
            return true;
        }
    }

Usage Example

Example #1
0
 public function getMainNavigation()
 {
     $d = new Database();
     $d->open('hacker_blog');
     $sql = "SELECT * FROM navigation ";
     if ($this->type == 'private') {
         $sql .= " WHERE public = 0 ";
     } else {
         $sql .= " WHERE private = 1 ";
     }
     $s = $d->q($sql);
     if ($s && $d->numrows() >= 1) {
         $arr = array();
         while ($r = $d->mfa()) {
             //print_r($r);
             array_push($arr, $r);
         }
         $this->messages = array("success" => "Found Navigation");
         $this->current = $arr;
         return $arr;
         $d->close();
     } else {
         $this->messages = array("error" => "Could not Find Navigation");
         $d->close();
         return false;
     }
 }
All Usage Examples Of Database::close