本文整理汇总了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]);
}
示例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'];
示例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();
示例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();
示例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);
示例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'];