當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBManager::db_query2方法代碼示例

本文整理匯總了PHP中DBManager::db_query2方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBManager::db_query2方法的具體用法?PHP DBManager::db_query2怎麽用?PHP DBManager::db_query2使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBManager的用法示例。


在下文中一共展示了DBManager::db_query2方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: DBManager

<?php

/**
 * Created by PhpStorm.
 * User: 재혁
 * Date: 2015-11-25
 * Time: 오후 11:06
*/
include "db_manager.php";
include 'xml_maker.php';
$db = new DBManager();
$table_name = $_GET["table"];
$file_name = $_GET["filename"];
//$total = $db->db_query2("select * from se_region_list");
$total = $db->db_query2("select * from " . $table_name);
$XmlConstruct = new XmlConstruct('table');
$count = 0;
foreach ($total as $row) {
    $XmlConstruct->startElement('row');
    $XmlConstruct->startAttribute('id');
    $XmlConstruct->text($count);
    $XmlConstruct->endAttribute();
    //echo "row[0] : ".$row[0]."          row[1] :  ".$row[1]."    row[2] :  ";
    //print_r($row);
    for ($i = 0; $i < count($row) / 2; $i++) {
        $XmlConstruct->startElement('att');
        if (!$row[$i]) {
            $XmlConstruct->text('NULL');
        } else {
            $XmlConstruct->text($row[$i]);
        }
開發者ID:smoper0916,項目名稱:Project,代碼行數:31,代碼來源:make_xml_table.php

示例2: DBManager

<?php

/**
 * Created by PhpStorm.
 * User: 재혁
 * Date: 2015-12-05
 * Time: 오후 8:58
 */
include 'xml_maker.php';
include 'db_manager.php';
$db = new DBManager();
// 디버깅용 db정보
$today = date("Y-m-d");
// 전국날씨 대상 기준코드 추출
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='서울특별시'");
$seoul_std_code = $std_arr[0]['std_code'];
echo $seoul_std_code . "nation!";
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='인천광역시'");
$incheon_std_code = $std_arr[0]['std_code'];
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='대전광역시'");
$daejeon_std_code = $std_arr[0]['std_code'];
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='대구광역시'");
$daegu_std_code = $std_arr[0]['std_code'];
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='광주광역시'");
$kwangju_std_code = $std_arr[0]['std_code'];
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='울산광역시'");
$ulsan_std_code = $std_arr[0]['std_code'];
$std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='부산광역시'");
$busan_std_code = $std_arr[0]['std_code'];
$std_arr = $db->db_query2("select std_code from se_all_region where big='제주특별자치도' and name='제주시'");
$jeju_std_code = $std_arr[0]['std_code'];
開發者ID:smoper0916,項目名稱:Project,代碼行數:31,代碼來源:show_national_weather.php

示例3: DBManager

<?php

include 'xml_maker.php';
include 'db_manager.php';
$db = new DBManager();
$big = $_GET['big'];
$mid = $_GET['mid'];
$small = $_GET['small'];
$table1 = $db->db_select_full("se_region_list", "code, x, y", "big='" . $big . "' and mid='" . $mid . "' and sm='" . $small . "'");
$region_code = $table1[0]['code'];
$today = date("Y-m-d");
$total = $db->db_query2("select * from  se_time_forecast where region_code='" . $region_code . "' and date='" . $today . "';");
$XmlConstruct = new XmlConstruct('time_weather');
$count = 0;
foreach ($total as $row) {
    $XmlConstruct->startElement('section');
    $XmlConstruct->startAttribute('id');
    $XmlConstruct->text($count);
    $XmlConstruct->endAttribute();
    $XmlConstruct->startElement('day');
    $XmlConstruct->text($row[day]);
    $XmlConstruct->endElement();
    $XmlConstruct->startElement('hour');
    $XmlConstruct->text($row[hour]);
    $XmlConstruct->endElement();
    $XmlConstruct->startElement('temp');
    $XmlConstruct->text($row[temp]);
    $XmlConstruct->endElement();
    $XmlConstruct->startElement('sky');
    $XmlConstruct->text($row[sky]);
    $XmlConstruct->endElement();
開發者ID:smoper0916,項目名稱:Project,代碼行數:31,代碼來源:visit_time_forecast.php

示例4: DBManager

<?php

/**
 * Created by PhpStorm.
 * User: 재혁
 * Date: 2015-11-25
 * Time: 오후 10:10
 */
include "db_manager.php";
include 'xml_maker.php';
$lat = $_GET["lat"];
$lon = $_GET["lon"];
$db = new DBManager();
$total = $db->db_query2("select code, lat, lon from se_region_list where lat BETWEEN '" . $lat . "'-0.2 and '" . $lat . "'+0.2 and lon BETWEEN '" . $lon . "'-0.2 and '" . $lon . "'+0.2");
$XmlConstruct = new XmlConstruct('search_result');
$count = 0;
foreach ($total as $row) {
    $XmlConstruct->startElement('row');
    $XmlConstruct->startAttribute('id');
    $XmlConstruct->text($count);
    $XmlConstruct->endAttribute();
    //echo "row[0] : ".$row[0]."          row[1] :  ".$row[1]."    row[2] :  ";
    //print_r($row);
    for ($i = 0; $i < count($row) / 2; $i++) {
        //echo $att."          ";
        $XmlConstruct->startElement('att');
        $XmlConstruct->text($row[$i]);
        //echo "값 : ".$att." count".$count."    ";
        $XmlConstruct->endElement();
    }
    $XmlConstruct->endElement();
開發者ID:smoper0916,項目名稱:Project,代碼行數:31,代碼來源:visit_search_result.php

示例5: DBManager

 * Created by PhpStorm.
 * User: 재혁
 * Date: 2015-12-05
 * Time: 오후 5:56
 */
include 'xml_maker.php';
include 'db_manager.php';
$db = new DBManager();
//광역시면 mid만 있으면 되고 일반 시이면 big, mid 둘 다 있어야 함
$big = $_GET['big'];
if (!$_GET['mid']) {
} else {
    $mid = $_GET['mid'];
}
if (strpos($big, '광역시') !== false || strpos($big, '특별시') !== false) {
    $std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='" . $big . "'");
} else {
    $std_arr = $db->db_query2("select std_code from se_all_region where big='" . $big . "' and name='" . $mid . "'");
}
$std_code = $std_arr[0]['std_code'];
$today = date("Y-m-d");
$total = $db->db_query2("select * from  se_day_forecast where region_code='" . $std_code . "' and date>='" . $today . "';");
$XmlConstruct = new XmlConstruct('week_weather');
$count = 0;
foreach ($total as $row) {
    if ($count > 5) {
        break;
    }
    $XmlConstruct->startElement('section');
    $XmlConstruct->startAttribute('id');
    $XmlConstruct->text($count);
開發者ID:smoper0916,項目名稱:Project,代碼行數:31,代碼來源:show_week_weather.php

示例6: DBManager

 * Time: 오전 1:30
 */
include 'xml_maker.php';
include 'db_manager.php';
$db = new DBManager();
$today = date("Y-m-d");
//echo $code;
$big = $_GET['big'];
$mid = $_GET['mid'];
$small = $_GET['small'];
$table1 = $db->db_select_full("se_region_list", "code, x, y", "big='" . $big . "' and mid='" . $mid . "' and sm='" . $small . "'");
$region_code = $table1[0]['code'];
echo "[1]" . $region_code;
$s_big = $big;
if (strpos($big, '광역시') !== false || strpos($big, '특별시') !== false) {
    $std_arr = $db->db_query2("select std_code from se_all_region where big is NULL and name='" . $big . "'");
} else {
    if (strlen($mid) >= 15) {
        $pos = strpos($mid, '시');
        $newMid = substr($mid, 0, $pos + 3);
        $std_arr = $db->db_query2("select std_code from se_all_region where big='" . $big . "' and name='" . $newMid . "'");
    } else {
        $std_arr = $db->db_query2("select std_code from se_all_region where big='" . $big . "' and name='" . $mid . "'");
    }
}
$std_code = $std_arr[0]['std_code'];
//$std_code = 17;
$day_total = $db->db_query2("select tmn, tmx, sky from  se_day_forecast where region_code='" . $std_code . "' and date>='" . $today . "';");
$tmx = $day_total[0]['tmx'];
$tmn = $day_total[0]['tmn'];
$t_tmx = $day_total[1]['tmx'];
開發者ID:smoper0916,項目名稱:Project,代碼行數:31,代碼來源:show_current_weather.php


注:本文中的DBManager::db_query2方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。