当前位置: 首页>>代码示例>>PHP>>正文


PHP MySQL::Connect方法代码示例

本文整理汇总了PHP中MySQL::Connect方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQL::Connect方法的具体用法?PHP MySQL::Connect怎么用?PHP MySQL::Connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MySQL的用法示例。


在下文中一共展示了MySQL::Connect方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Connect

	function Connect ()
	{
		if (DATABASE_TYPE == "PGSQL")
		{
			PGSQL::Connect ();
		}
		elseif (DATABASE_TYPE == "MYSQL")
		{
			MySQL::Connect ();
		}
	}
开发者ID:sotonin,项目名称:Sparkle-PHP-Framework,代码行数:11,代码来源:Database.php

示例2: MySQL

<?php

include "../global.php";
$DB = new MySQL();
$DB->Connect();
$Data = array($_POST['size'] / 10, $_POST['closed'] * 10, $_POST['diagonal'], $_POST['truediagonal'], $_POST['heuristic'], $_POST['break'], $_POST['steps'], $_POST['searched']);
if ($Data[2] == 'false') {
    $Data[2] = 0;
} else {
    $Data[2] = 1;
}
if ($Data[3] == 'false') {
    $Data[3] = 0;
} else {
    $Data[3] = 1;
}
foreach ($Data as $Number) {
    if (!is_numeric($Number)) {
        exit;
    }
}
$SQL = "INSERT INTO AStarPaths (MapDimensions, ClosedPercent, MoveDiagonally, TrueDiagonalDistance, HeuristicMethod, BreakTies, PathSteps, ExtraSearched) VALUES ({$Data['0']}, {$Data['1']}, {$Data['2']}, {$Data['3']}, {$Data['4']}, {$Data['5']}, {$Data['6']}, {$Data['7']});";
$DB->Execute($SQL);
开发者ID:ryanvq,项目名称:astar,代码行数:23,代码来源:AStarSavePath.php

示例3: array

     build_page($method);
     break;
 case "delete":
     $log_info = $setting['language']['admin_art_tag_delete'];
     $tag = $db->result($setting['db']['pre_sub'] . "news_tag", "tag", array("id", "n=", $id));
     $db->update($setting['db']['pre_sub'] . "news_show", array("tag" => ''), array("id", "n=", $id));
     $db->update($setting['db']['pre_sub'] . "news_show", array("tag" => "REPLACE(tag, '" . $tag . ",', '')"), array("tag", "like", $tag));
     $db->update($setting['db']['pre_sub'] . "news_show", array("tag" => "REPLACE(tag, '," . $tag . "', '')"), array("tag", "like", $tag));
     $db->delete($setting['db']['pre_sub'] . "news_tag", array("id", "n=", $id));
     break;
 case "rebuild":
     set_time_limit(0);
     $log_info = $setting['language']['admin_art_tag_rebuild'];
     $db_tmp = new MySQL();
     $db_tmp->init($setting['db']['host'], $setting['db']['user'], $setting['db']['pass'], $setting['db']['charset']);
     $db_tmp->Connect(false);
     $db_tmp->SelectDB($setting['db']['name']);
     $db_tmp->update($setting['db']['pre_sub'] . "news_tag", array("count" => 0));
     $db->ReConnect(true, $setting['db']['name']);
     $n = 1;
     $db->select($setting['db']['pre_sub'] . "news_show", "news_id, tag", array(), array("order" => "news_id"));
     while ($record = $db->GetRS()) {
         $the_tag = $record['tag'];
         $the_tag = str_replace("¡¢", ",", $the_tag);
         $the_tag = str_replace("£¬", ",", $the_tag);
         $the_tag = str_replace("¡¡", " ", $the_tag);
         $the_tag = str_replace(" ", "_", $the_tag);
         $the_tag = explode(",", $the_tag);
         $max_count = count($the_tag);
         for ($n = 0; $n < $max_count; $n++) {
             $the_tag[$n] = trim($the_tag[$n], "_");
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:art_tag.php

示例4: url

    }
    include_once "gzip_header.php";
    echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head>\n\t<title>SGCP Install System</title>\n\t<meta name=\"Author\" content=\"" . $CP[author] . "\">\n\t<meta name=\"Keywords\" content=\"" . $CP[name] . "\">\n\t<meta name=\"Description\" content=\"" . $CP[credit] . "\">\n\t<meta name=\"Copyright\" content=\"" . $CP[name] . " (c) " . $CP[corp] . "\">\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\">\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"theme/{$STORED['THEME']}/style.css\">\n\t<style type=\"text/css\">\n\t\t.title_bar {\n\t\t\tBACKGROUND-IMAGE: url(theme/{$STORED['THEME']}/{$THEME['title_bar_img_url']})\n\t\t}\n\t\t.title_bar2 {\n\t\t\tBACKGROUND-IMAGE: url(theme/{$STORED['THEME']}/{$THEME['title_bar2_img_url']})\n\t\t}\n\t</style>\n</head>\n<body " . $THEME[background] . ">\n<form action=\"install.php?code=01\" method=\"post\" enctype=\"multipart/form-data\" name=\"Create_DB\" OnSubmit=\"document.Create_DB.Submit.disabled=true;\")>\n\t<input type=\"hidden\" name=\"system_safe\" value=\"1\">\n\t\t<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" class=\"topic_title\">\n\t\t\t<TBODY>\n\t\t\t\t<TR class=\"title_bar\" height=29>\n\t\t\t\t\t<TD>\n\t\t\t\t\t\t<div class=\"m_title\">\n\t\t\t\t\t\t\t<B>&nbsp;&nbsp;Creating Database: {$CONFIG_sql_cpdbname}</B>\n\t\t\t\t\t\t</font>\n\t\t\t\t\t</TD>\n\t\t\t\t</TR>\n\t\t\t\t<TR>\n\t\t\t\t\t<TD>\n\t\t\t\t\t\t<TABLE width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" align=\"center\">\n\t\t\t\t\t\t\t<TBODY>\n\t\t\t\t\t\t\t\t<TR class=\"topic_title5\">\n\t\t\t\t\t\t\t\t\t<TD height=\"27\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"title_face\">\n\t\t\t\t\t\t\t\t\t\t\t<B>CP can't working now it must to create a {$CONFIG_sql_cpdbname} database. You want to create it at this time.</B>\n\t\t\t\t\t\t\t\t\t\t</font>\n\t\t\t\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t\t\t</TR>\n\t\t\t\t\t\t\t\t<TR class=\"topic_title5\">\n\t\t\t\t\t\t\t\t\t<TD width=\"100%\" align=\"center\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"Submit\" value=\"Create a database\" class=\"textinput\">\n\t\t\t\t\t\t\t\t\t</TD>\n\t\t\t\t\t\t\t\t</TR>\n\t\t\t\t\t\t\t</TBODY>\n\t\t\t\t\t\t</TABLE>\n\t\t\t\t\t</TD>\n\t\t\t\t</TR>\n\t\t\t</TBODY>\n\t\t</TABLE>\n</form>\n</body>\n</html>";
    mysql_close();
    include_once "gzip_footer.php";
} else {
    if ($_GET[code] == '01') {
        if ($_POST['system_safe'] != '1') {
            header("location:index.php?act=idx");
        }
        require "memory.php";
        require "function/lib_install.php";
        include_once "gzip_header.php";
        echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n<head>\n\t<meta name=\"Author\" content=\"" . $CP[author] . "\">\n\t<meta name=\"Keywords\" content=\"" . $CP[name] . "\">\n\t<meta name=\"Description\" content=\"" . $CP[credit] . "\">\n\t<meta name=\"Copyright\" content=\"" . $CP[name] . " (c) " . $CP[corp] . "\">\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\">\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"theme/{$STORED['THEME']}/style.css\">\n\t<style type=\"text/css\">\n\t\t.title_bar {\n\t\t\tBACKGROUND-IMAGE: url(theme/{$STORED['THEME']}/{$THEME['title_bar_img_url']})\n\t\t}\n\t\t.title_bar2 {\n\t\t\tBACKGROUND-IMAGE: url(theme/{$STORED['THEME']}/{$THEME['title_bar2_img_url']})\n\t\t}\n\t</style>\n</head>\n<body " . $background . ">\n";
        $sql = new MySQL();
        $sql->Connect($CONFIG_sql_host, $CONFIG_sql_username, $CONFIG_sql_password);
        $query = "SELECT COUNT(*) FROM {$CONFIG_sql_cpdbname}.memory WHERE memory_object =\"sgcp_install\" AND memory_value1=\"1\"";
        $sql->result = mysql_query($query);
        if (!$sql->result()) {
            if (mysql_select_db($CONFIG_sql_cpdbname)) {
                $dropdb = "DROP DATABASE `{$CONFIG_sql_cpdbname}`;";
                mysql_query($dropdb);
            }
            $createdb = "CREATE DATABASE `{$CONFIG_sql_cpdbname}`;";
            if (mysql_query($createdb)) {
                if ($contents = file_get_contents("install/sql-files/sgcp_database.sql")) {
                    $cpi = new CP_Install();
                    $execute_query = $cpi->promt_query($contents);
                    for ($i = 0; $i < count($execute_query); $i++) {
                        mysql_db_query($CONFIG_sql_cpdbname, $execute_query[$i]);
                    }
开发者ID:koeznailbiter,项目名称:Koez-RO-CP,代码行数:31,代码来源:install.php

示例5: Array

var tinyMCEImageList = new Array(
	<?php 
include '../system/classes/imageserver.php';
include '../system/classes/database.php';
include '../system/classes/language.php';
include '../system/classes/settings.php';
include '../system/classes/cache.php';
include '../system/classes/filecache.php';
include '../system/classes/mysql.php';
include '../system/classes/user.php';
include '../system/classes/role.php';
include '../system/classes/page.php';
include '../system/classes/sys.php';
include '../const.php';
$db = new MySQL('../system/dbsettings.php');
$db->Connect();
DataBase::SetCurrent($db);
$language = new Language();
Settings::$allowFileCache = false;
$images = ImageServer::getImages();
if ($images) {
    $i = 1;
    foreach ($images as $image) {
        ?>
		  ["<?php 
        echo $image->name;
        ?>
", "<?php 
        echo $image->path;
        ?>
"]
开发者ID:srueegger,项目名称:1zu12bB,代码行数:31,代码来源:imagelist.php

示例6: Init

	function Init ()
	{
		MySQL::Connect ();
		MySQL::SelectDB ();
	}
开发者ID:sotonin,项目名称:Sparkle-PHP-Framework,代码行数:5,代码来源:MySQL.php

示例7: client_info

$code = $_SERVER["HTTP_MS_SIGN"];
$code = preg_replace("/\\W/", "", $code);
if (strlen($code) != 32 && false) {
    header("HTTP/1.0 404 Not Found");
    exit;
}
define('ROOT_PATH', str_replace("\\", "/", realpath(dirname(__FILE__) . "/../")));
include ROOT_PATH . "/include/config.php";
include ROOT_PATH . "/include/parameter.php";
require ROOT_PATH . "/source/function/global.php";
require ROOT_PATH . "/source/class/abstract.class.php";
require ROOT_PATH . "/source/class/mysql.class.php";
require ROOT_PATH . "/source/class/mydb.class.php";
require "version.php";
$db = new MySQL($setting['db']['host'], $setting['db']['user'], $setting['db']['pass'], $setting['db']['charset']);
$db->Connect($setting['db']['pconnect'], $setting['db']['name']);
function client_info($mode = "")
{
    global $db, $setting, $code;
    if (empty($code)) {
        $code = $_SERVER["HTTP_MS_SIGN"];
    }
    $code = preg_replace("/\\W/", "", $code);
    if (strlen($code) != 32) {
        return;
    }
    if ($db->getRecord("show tables like 'ms_client_info'") == false) {
        $sql = "\r\n\t\t\tCREATE TABLE `{pre}client_info` (\r\n\t\t\t\t`idx` Char(40) NOT NULL UNIQUE,\r\n\t\t\t\t`title` Char(60) Default '' NOT NULL,\r\n\t\t\t\t`domain` Char(50) Default '' NOT NULL,\r\n\t\t\t\t`ip` Char(20) Default '' NOT NULL,\r\n\t\t\t\t`email` Char(40) Default '' NOT NULL,\r\n\t\t\t\t`date_install` datetime NULL,\r\n\t\t\t\t`date_check` datetime NULL,\r\n\t\t\t\t`date_update` datetime NULL,\r\n\t\t\t\t`version` Char(20) Default '' NOT NULL,\r\n\t\t\t\t`info` Char(255) Default '',\r\n\t\t\t\tPRIMARY KEY (`idx`)\r\n\t\t\t) ENGINE=MyISAM DEFAULT CHARSET={charset};\r\n\t\t";
        $sql = str_replace("{pre}", $setting['db']['pre'], $sql);
        $sql = str_replace("{charset}", $setting['db']['charset'], $sql);
        $db->Query($sql);
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:index.php

示例8: getSubSetting

switch ($method) {
    case "trans":
        $cat_id = $req->getReq("cat_id");
        $org_id = $_POST['web_id_org'];
        $dst_id = $_POST['web_id_dst'];
        $log_info = $setting['language']['plugin_data_trans_title'];
        $setting_org = getSubSetting($org_id);
        $setting_dst = getSubSetting($dst_id);
        $pre_org = "{$setting_org['db']['name']}.{$setting_org['db']['pre']}";
        $pre_dst = "{$setting_dst['db']['name']}.{$setting_dst['db']['pre']}";
        if ($pre_org == $pre_dst) {
            showInfo($setting['language']['plugin_data_trans_error']);
        }
        $db2 = new MySQL();
        $db2->init($setting['db']['host'], $setting['db']['user'], $setting['db']['pass'], $setting['db']['charset']);
        $db2->Connect(false, $setting['db']['name']);
        $db->ReConnect(true);
        if ($cat_id == 0) {
            foreach ($GLOBALS['news_cat'] as $cur_cat) {
                if ($cur_cat['web_id'] != $org_id) {
                    continue;
                }
                if ($org_id != $dst_id) {
                    $db->update($setting['db']['pre'] . "news_cat", array("web_id" => $dst_id), array("cat_id", "n=", $cur_cat['cat_id']));
                }
                $db->select($pre_org . "news_show", "*", array("cat_id", "n=", $cur_cat['cat_id']), array("order" => "news_id asc"));
                $id_list = array();
                while ($record = $db->GetRS()) {
                    $the_id = array();
                    $the_id['old'] = $record['news_id'];
                    $record['news_id'] = 0;
开发者ID:laiello,项目名称:mystep-cms,代码行数:31,代码来源:data_trans.php


注:本文中的MySQL::Connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。