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


PHP Mysql::Query方法代码示例

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


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

示例1: adicionar_contador

 public static function adicionar_contador($tabela, $id)
 {
     $db = new Mysql();
     switch ($tabela) {
         case 'NOTICIA':
             $campo_id = 'NOTICIA_CDG';
             break;
         case 'ITEM':
             $campo_id = 'ITEM_CDG';
             break;
     }
     $db->Query(' UPDATE ' . $tabela . ' SET ' . $tabela . '_VIEW = ' . $tabela . '_VIEW + 1 
                   WHERE ' . $campo_id . ' = ' . $id);
 }
开发者ID:marcosyyz,项目名称:dm,代码行数:14,代码来源:Contador.php

示例2: Mysql

include_once "config.inc.php";
include_once "templates/header.html";
include_once "templates/install_manager_sidebar.html";
$mysql = new Mysql();
$install = new Install();
$monitor = new NodeMonitor();
if (!@$_GET['action']) {
    echo '<div class="span10">
	' . $lang['chooseLeftSidebar'] . '
	</div>';
} elseif ($_GET['action'] == "Install") {
    if (!$_GET['ip']) {
        echo '<div class=span10>';
        echo '<h2>' . $lang['chooseInstallHost'] . '</h2>';
        $sql = "select * from ehm_hosts order by create_time desc";
        $mysql->Query($sql);
        echo '<table class="table table-striped">';
        echo '<thead>
                <tr>
                  <th>#</th>
                  <th>' . $lang['hostname'] . '</th>
                  <th>' . $lang['ipAddr'] . '</th>
                  <th>' . $lang['nodeRole'] . '</th>
                  <th>' . $lang['createTime'] . '</th>
                  <th>' . $lang['action'] . '</th>
                </tr>
                </thead>
                <tbody>';
        $i = 1;
        while ($arr = $mysql->FetchArray()) {
            echo '<tr>
开发者ID:npk,项目名称:easyhadoop,代码行数:31,代码来源:InstallManager.php

示例3: die

<?php

/*
 *	@author: Tomáš Mičulka
 *	@version: 2.0
 *	@last_update: 7.1.2014 
 */
defined('IN_INNE') or die("Acces denied!");
$database = new Mysql(false);
$dataTemp = array();
$dataList = $database->handler->real_escape_string($_POST["structure"]);
$dataList = parse_str($dataList, $dataTemp);
$dataId = $database->handler->real_escape_string($_POST["id"]);
for ($counter = 1; $counter <= count($dataTemp[pos]); $counter++) {
    $database->Query("UPDATE " . TABLE_PREFIX . "pages SET pagePosition='{$counter}' WHERE pageId='" . $dataTemp[pos][$counter - 1] . "';");
}
开发者ID:tommmic,项目名称:inne,代码行数:16,代码来源:savePageStructure.php

示例4: AnalyzeHotelList

	public static function AnalyzeHotelList($cityId)
	{
$logger = \Logger :: GetLogger("ctrip");
		$xml = simplexml_load_file(__DIR__ . "/hotellistdata/city" . $cityId . ".xml");

		if(!isset($xml->HotelResponse->OTA_HotelSearchRS->Properties))	return;
		$hotelList = $xml->HotelResponse->OTA_HotelSearchRS->Properties;
		
		$sqlObject = new \Mysql();
		
		$hotelIndex = 0;
		foreach($hotelList->children() as $hotel)
		{
			$hotelIndex++;
$logger->info("开始分析第" . $hotelIndex . "个酒店", __FUNCTION__);
			$hotelId = intval($hotel["HotelCode"]);
			if($cityId != intval($hotel["HotelCityCode"]))
			{
$logger->error("查询到的酒店的HotelCityCode(" . $hotel["HotelCityCode"] . ")和($cityId)不一致", __FUNCTION__);
			}
			$hotelName = strval($hotel["HotelName"]);
			$districtId = intval($hotel["AreaID"]);
			$hotelCode = intval($hotel["HotelId"]);
			if($hotelId != $hotelCode)
			{
$logger->error("查询到的酒店的HotelCode($hotelId)和HotelId($hotelCode)不一致", __FUNCTION__);
			}
			$brandId = intval($hotel["BrandCode"]);
			
			$sql = "INSERT INTO ctrip_hotel (id, city_id, name, district_id, brand_id) VALUES ($hotelId, $cityId, '$hotelName', $districtId, $brandId);";
			$sqlObject->Query($sql);
			
			if(isset($hotel->VendorMessages))
			{
				foreach($hotel->VendorMessages->children() as $message)
				{
					$infoType = intval($message["InfoType"]);
					if($infoType == 23)
					{
						$sql = "INSERT INTO ctrip_hotel_image (hotel_id, url) VALUES ($hotelId, '" . strval($message->SubSection->Paragraph->Text) . "');";
						$sqlObject->Query($sql);
					}
					else if($infoType == 1)
					{
						$sql = "INSERT INTO ctrip_hotel_description (hotel_id, description) VALUES ($hotelId, '" . strval($message->SubSection->Paragraph->Text) . "');";
						$sqlObject->Query($sql);
					}
					else
					{
$logger->error("查询到的酒店的信息(" . $infoType . "):" . strval($message->SubSection->Paragraph->Text), __FUNCTION__);
					}
				}
			}
			
			$address = strval($hotel->Address->AddressLine);
			$sql = "UPDATE ctrip_hotel SET address = '$address' WHERE id = $hotelId;";
			$sqlObject->Query($sql);
			
			$awardList = $hotel->Award; 
			for($i = 0; $i < count($awardList); $i++)
			{
				switch(strval($awardList[$i]["Provider"]))
				{
					case "HotelStarRate":
						$fieldName = "star_rate";
						break;
					case "CtripStarRate":
						$fieldName = "ctrip_star_rate";
						break;
					case "CtripRecommendRate":
						$fieldName = "ctrip_recommend_rate";
						break;
					case "CtripCommRate":
						$fieldName = "ctrip_client_rate";
						break;
					case "CommSurroundingRate":
						$fieldName = "ctrip_client_surrounding_rate";
						break;
					case "CommFacilityRate":
						$fieldName = "ctrip_client_facility_rate";
						break;
					case "CommCleanRate":
						$fieldName = "ctrip_client_clean_rate";
						break;
					case "CommServiceRate":
						$fieldName = "ctrip_client_service_rate";
						break;
					default:
$logger->error("查询到的酒店的星级(" . strval($awardList[$i]["Provider"]) . "):" . doubleval($awardList[$i]["Rating"]), __FUNCTION__);
				}
				$sql = "UPDATE ctrip_hotel SET $fieldName = " . doubleval($awardList[$i]["Rating"]) . " WHERE id = $hotelId;";
				$sqlObject->Query($sql);
			}
			
			/*未解析RelativePosition结点,因为下面一个接口有更详细的信息
			if(isset($hotel->RelativePosition))
			{
				$relativePositionList = $hotel->RelativePosition;
				for($i = 0; $i < count($relativePositionList); $i++)
				{
//.........这里部分代码省略.........
开发者ID:nonenull,项目名称:doc,代码行数:101,代码来源:hotel.php

示例5: Mysql

<?php

include_once "../../model/mysql.php";
$message = $_POST['texto'];
$message = nl2br($message);
$db = new Mysql();
$db->Query(" INSERT INTO TESTE(TEXTO,TEXTOTEXTO) VALUES('" . $message . "','" . $message . "')");
echo $message;
开发者ID:marcosyyz,项目名称:self,代码行数:8,代码来源:gravar.php

示例6: EditPage

 public function EditPage($pageId, $pageContent)
 {
     $database = new Mysql(false);
     $database->Query("UPDATE " . TABLE_PREFIX . "m_text_master SET pageContent='{$pageContent}' WHERE pageId='{$pageId}';");
 }
开发者ID:tommmic,项目名称:inne,代码行数:5,代码来源:class-m-page.php


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