mysql.log 에서 쿼리가 한줄로 보여질수 있도록 쿼리문 수정

This commit is contained in:
gnuboard
2013-07-23 13:11:53 +09:00
parent 291f9d9b79
commit 318c868274
5 changed files with 17 additions and 60 deletions

View File

@ -475,13 +475,9 @@ function display_type($type, $skin_file, $list_mod, $list_row, $img_width, $img_
// 1.02.00
// it_order 추가
$sql = " select *
from {$g4['shop_item_table']}
where it_use = '1'
and it_type{$type} = '1' ";
$sql = " select * from {$g4['shop_item_table']} where it_use = '1' and it_type{$type} = '1' ";
if ($ca_id) $sql .= " and ca_id like '$ca_id%' ";
$sql .= " order by it_order, it_id desc
limit $items ";
$sql .= " order by it_order, it_id desc limit $items ";
$result = sql_query($sql);
/*
if (!mysql_num_rows($result)) {
@ -508,13 +504,9 @@ function mobile_display_type($type, $skin_file, $list_row, $img_width, $img_heig
// 1.02.00
// it_order 추가
$sql = " select *
from {$g4['shop_item_table']}
where it_use = '1'
and it_type{$type} = '1' ";
$sql = " select * from {$g4['shop_item_table']} where it_use = '1' and it_type{$type} = '1' ";
if ($ca_id) $sql .= " and ca_id like '$ca_id%' ";
$sql .= " order by it_order, it_id desc
limit $items ";
$sql .= " order by it_order, it_id desc limit $items ";
$result = sql_query($sql);
/*
if (!mysql_num_rows($result)) {
@ -815,10 +807,7 @@ function print_item_options($it_id, $uq_id)
{
global $g4;
$sql = " select ct_option, ct_qty
from {$g4['shop_cart_table']}
where it_id = '$it_id' and uq_id = '$uq_id'
order by io_type asc, ct_num asc, ct_id asc ";
$sql = " select ct_option, ct_qty from {$g4['shop_cart_table']} where it_id = '$it_id' and uq_id = '$uq_id' order by io_type asc, ct_num asc, ct_id asc ";
$result = sql_query($sql);
$str = '';
@ -898,15 +887,9 @@ function display_event($no, $event, $list_mod, $list_row, $img_width, $img_heigh
// 1.02.00
// b.it_order 추가
$sql = " select b.*
from {$g4['shop_event_item_table']} a,
{$g4['shop_item_table']} b
where a.it_id = b.it_id
and b.it_use = '1'
and a.ev_id = '$event' ";
$sql = " select b.* from {$g4['shop_event_item_table']} a, {$g4['shop_item_table']} b where a.it_id = b.it_id and b.it_use = '1' and a.ev_id = '$event' ";
if ($ca_id) $sql .= " and ca_id = '$ca_id' ";
$sql .= " order by b.it_order, a.it_id desc
limit $items ";
$sql .= " order by b.it_order, a.it_id desc limit $items ";
$result = sql_query($sql);
if (!mysql_num_rows($result)) {
return false;
@ -1100,11 +1083,7 @@ function display_relation_item($it_id, $width, $height, $rows=3)
if(!$it_id)
return $str;
$sql = " select b.it_id, b.it_name, b.it_price, b.it_tel_inq, b.it_gallery
from {$g4['shop_item_relation_table']} a left join {$g4['shop_item_table']} b on ( a.it_id2 = b.it_id )
where a.it_id = '$it_id'
order by ir_no asc
limit 0, $rows ";
$sql = " select b.it_id, b.it_name, b.it_price, b.it_tel_inq, b.it_gallery from {$g4['shop_item_relation_table']} a left join {$g4['shop_item_table']} b on ( a.it_id2 = b.it_id ) where a.it_id = '$it_id' order by ir_no asc limit 0, $rows ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
@ -1213,10 +1192,7 @@ function insert_mileage($mb_id, $point, $content='', $od_id, $ct_id)
// 이미 등록된 내역이라면 건너뜀
if($od_id && $ct_id) {
$sql = " select count(*) as cnt from {$g4['shop_mileage_table']}
where mb_id = '$mb_id'
and od_id = '$od_id'
and ct_id = '$ct_id' ";
$sql = " select count(*) as cnt from {$g4['shop_mileage_table']} where mb_id = '$mb_id' and od_id = '$od_id' and ct_id = '$ct_id' ";
$row = sql_fetch($sql);
if ($row['cnt'])
return -1;

View File

@ -8,13 +8,8 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<ul>
<?php
$hsql = "
select a.it_id, a.it_name, a.ct_qty
from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id )
where a.uq_id = '".get_session('ss_uq_id')."'
and a.ct_num = '0'
order by a.ct_id
";
$hsql = " select a.it_id, a.it_name, a.ct_qty from {$g4['shop_cart_table']} a left join {$g4['shop_item_table']} b on ( a.it_id = b.it_id ) ";
$hsql .= " where a.uq_id = '".get_session('ss_uq_id')."' and a.ct_num = '0' order by a.ct_id ";
$hresult = sql_query($hsql);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{

View File

@ -8,12 +8,8 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<ul>
<?php
$hsql = "
select a.it_id, b.it_name from {$g4['shop_wish_table']} a, {$g4['shop_item_table']} b
where a.mb_id = '{$member['mb_id']}'
and a.it_id = b.it_id
order by a.wi_id desc
";
$hsql = " select a.it_id, b.it_name from {$g4['shop_wish_table']} a, {$g4['shop_item_table']} b ";
$hsql .= " where a.mb_id = '{$member['mb_id']}' and a.it_id = b.it_id order by a.wi_id desc ";
$hresult = sql_query($hsql);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{

View File

@ -3,10 +3,7 @@ include_once('./_common.php');
$it_id = $_POST['it_id'];
$sql = " select it_id, it_option_subject, it_supply_subject, it_price, it_point, it_point_type
from {$g4['shop_item_table']}
where it_id = '$it_id'
and it_use = '1' ";
$sql = " select it_id, it_option_subject, it_supply_subject, it_price, it_point, it_point_type from {$g4['shop_item_table']} where it_id = '$it_id' and it_use = '1' ";
$it = sql_fetch($sql);
$it_point = get_item_point($it);
@ -19,8 +16,7 @@ $sql = " select * from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id
$result = sql_query($sql);
// 판매가격
$sql2 = " select ct_price, it_name, ct_send_cost
from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' ";
$sql2 = " select ct_price, it_name, ct_send_cost from {$g4['shop_cart_table']} where uq_id = '$uq_id' and it_id = '$it_id' and ct_num = '0' ";
$row2 = sql_fetch($sql2);
if(!mysql_num_rows($result))

View File

@ -34,9 +34,7 @@ if ($sort != "")
$sql_list1 = " select * ";
$sql_list2 = " order by $order_by it_order, it_id desc ";
$sql_common = " from {$g4['shop_item_table']}
where it_type{$type} = '1'
and it_use = '1' ";
$sql_common = " from {$g4['shop_item_table']} where it_type{$type} = '1' and it_use = '1' ";
if ($ca_id) {
$sql_common .= " and ca_id = '$ca_id' ";
}
@ -84,11 +82,7 @@ echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_S
// 분류를 링크하는 코드
/*
$bar = "";
$sql = " select ca_id from $g4[shop_item_table]
where it_type{$type} = '1'
and it_use = '1'
group by ca_id
order by ca_id ";
$sql = " select ca_id from $g4[shop_item_table] where it_type{$type} = '1' and it_use = '1' group by ca_id order by ca_id ";
$result = sql_query($sql);
for($i=0;$row=sql_fetch_array($result);$i++) {
$row2 = sql_fetch(" select ca_name from $g4[shop_category_table] where ca_id = '$row[ca_id]' ");