MySQL::Close PHP Method

Close() public method

Close current MySQL connection
public Close ( ) : object
return object Returns TRUE on success or FALSE on error
    public function Close()
    {
        $this->ResetError();
        $this->active_row = -1;
        $success = $this->Release();
        if ($success) {
            $success = @mysqli_close($this->mysql_link);
            if (!$success) {
                $this->SetError();
            } else {
                unset($this->last_sql);
                unset($this->last_result);
                unset($this->mysql_link);
            }
        }
        return $success;
    }

Usage Example

Example #1
0
            if (++$n % 50 === 0) {
                $db_tmp->ReConnect(false, $setting['db']['name']);
            }
        }
        $db_tmp->delete($setting['db']['pre_sub'] . "news_tag", array(array("count", "n<", 2), array("click", "n<", 5, "and"), array("add_date", "f<", "UNIX_TIMESTAMP()-60*60*24*10", "and")));
        $db->Free();
        $n = 1;
        $db->select($setting['db']['pre_sub'] . "news_tag", "id, tag");
        while ($record = $db->GetRS()) {
            $counter = $db_tmp->result($setting['db']['pre_sub'] . "news_show", "count(*)", array("tag", "like", $record['tag']));
            $db_tmp->update($setting['db']['pre_sub'] . "news_tag", array("count" => $counter), array("id", "n=", $record['id']));
            if (++$n % 50 === 0) {
                $db_tmp->ReConnect(false, $setting['db']['name']);
            }
        }
        $db_tmp->Close();
        unset($db_tmp);
        break;
    default:
        break;
}
if (!empty($log_info)) {
    write_log($log_info, "id={$id}");
    $goto_url = $setting['info']['self'] . "?web_id=" . $web_id;
}
$mystep->pageEnd(false);
function build_page($method)
{
    global $mystep, $req, $db, $tpl, $tpl_info, $setting, $id, $web_id, $setting_sub;
    $tpl_info['idx'] = "art_tag";
    $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
All Usage Examples Of MySQL::Close