<?
$qry = "SELECT op_pcode,sum(op_cnt) as cnt
FROM view_order where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
group by op_pcode
order by cnt desc limit 10";
$qry = "SELECT op_pcode,sum(op_cnt) as cnt
FROM view_order where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
group by op_pcode
order by cnt desc limit 10";
$rlt = mysql_query($qry);
while($row = mysql_fetch_array($rlt)) {
$pcode = $row['op_pcode'];
$pcnt = $row['cnt'];
//상품명
$prslt = mysql_fetch_array(mysql_query("select name,cateCode,price_org,price,saleCnt from odtProduct where code='".$pcode."'"));
$pname = $prslt[name];
$price_org = $prslt[price_org];
$price = $prslt[price];
$pcatecode = $prslt[cateCode];
$psalecnt = $prslt[saleCnt];
$prslt = mysql_fetch_array(mysql_query("select name,cateCode,price_org,price,saleCnt from odtProduct where code='".$pcode."'"));
$pname = $prslt[name];
$price_org = $prslt[price_org];
$price = $prslt[price];
$pcatecode = $prslt[cateCode];
$psalecnt = $prslt[saleCnt];
//카레고리명
$pcatename = mysql_result(mysql_query("select catename from odtCategory where catecode='".$pcatecode."'"),0);
$pcatename = mysql_result(mysql_query("select catename from odtCategory where catecode='".$pcatecode."'"),0);
?>
이것들이 다 무슨 말이지요?? 저는 디비 안에 있는 [saleCnt] 라는 디비값만 가져오고 싶은데...
저 위의 구문이 해석이 안되니 힘드네요 ..
빨간색 구문은 특히 이해가 안갑니다 무슨 설정 값인지..
아래부분은 대충 이해는 했습니다만 ㅠㅠ
해석해주실 능력자분 계신가요?
댓글 3개
13년 전
자유게시판에서 게시물 이동됩니다.
13년 전
SELECT 검색해라
op_pcode,sum(op_cnt) as cnt 를
FROM view_order 이테이블에서
where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
조건은 지불상태가y이면서 취소하지 않은것을 그리고 isnow 상태가 비어있다면 n으로 바꿔라 그 isnow 가 y 인조건으로
group by op_pcode
그결과를 op_pcode 로 묵어라
order by cnt desc
소팅하라 cnt가 높은순으로
limit 10
그중 10개만 출력하라 정도 되겠습니다
op_pcode,sum(op_cnt) as cnt 를
FROM view_order 이테이블에서
where paystatus = 'Y'
and canceled = 'N'
and ifnull(isNow,'N') = 'Y'
조건은 지불상태가y이면서 취소하지 않은것을 그리고 isnow 상태가 비어있다면 n으로 바꿔라 그 isnow 가 y 인조건으로
group by op_pcode
그결과를 op_pcode 로 묵어라
order by cnt desc
소팅하라 cnt가 높은순으로
limit 10
그중 10개만 출력하라 정도 되겠습니다
13년 전
정말 감사합니다!!! 많은 도움이 되었어요!! ㅠㅠ
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 8230 | 9년 전 | 194 | ||
| 8229 | 9년 전 | 175 | ||
| 8228 |
커네드커네드
|
9년 전 | 215 | |
| 8227 | 9년 전 | 253 | ||
| 8226 | 9년 전 | 275 | ||
| 8225 | 9년 전 | 258 | ||
| 8224 | 9년 전 | 262 | ||
| 8223 | 9년 전 | 241 | ||
| 8222 |
|
9년 전 | 302 | |
| 8221 | 9년 전 | 199 | ||
| 8220 | 9년 전 | 242 | ||
| 8219 | 9년 전 | 218 | ||
| 8218 | 9년 전 | 260 | ||
| 8217 |
star3840
|
9년 전 | 218 | |
| 8216 | 9년 전 | 293 | ||
| 8215 | 9년 전 | 241 | ||
| 8214 | 9년 전 | 344 | ||
| 8213 | 9년 전 | 305 | ||
| 8212 | 9년 전 | 218 | ||
| 8211 | 9년 전 | 388 | ||
| 8210 | 9년 전 | 383 | ||
| 8209 | 9년 전 | 464 | ||
| 8208 | 9년 전 | 345 | ||
| 8207 | 9년 전 | 360 | ||
| 8206 |
|
9년 전 | 307 | |
| 8205 | 9년 전 | 280 | ||
| 8204 | 9년 전 | 269 | ||
| 8203 | 9년 전 | 347 | ||
| 8202 | 9년 전 | 254 | ||
| 8201 | 9년 전 | 298 | ||
| 8200 | 9년 전 | 302 | ||
| 8199 | 9년 전 | 326 | ||
| 8198 | 9년 전 | 288 | ||
| 8197 | 9년 전 | 282 | ||
| 8196 | 9년 전 | 704 | ||
| 8195 | 9년 전 | 289 | ||
| 8194 | 9년 전 | 397 | ||
| 8193 | 9년 전 | 313 | ||
| 8192 | 9년 전 | 313 | ||
| 8191 | 9년 전 | 277 | ||
| 8190 | 9년 전 | 258 | ||
| 8189 | 9년 전 | 321 | ||
| 8188 | 9년 전 | 253 | ||
| 8187 | 9년 전 | 270 | ||
| 8186 | 9년 전 | 270 | ||
| 8185 | 9년 전 | 438 | ||
| 8184 | 9년 전 | 221 | ||
| 8183 | 9년 전 | 427 | ||
| 8182 | 9년 전 | 298 | ||
| 8181 | 9년 전 | 249 | ||
| 8180 | 9년 전 | 826 | ||
| 8179 | 9년 전 | 604 | ||
| 8178 | 9년 전 | 462 | ||
| 8177 |
kiplayer
|
9년 전 | 458 | |
| 8176 | 9년 전 | 494 | ||
| 8175 | 9년 전 | 376 | ||
| 8174 | 9년 전 | 371 | ||
| 8173 | 9년 전 | 458 | ||
| 8172 | 9년 전 | 340 | ||
| 8171 | 9년 전 | 304 | ||
| 8170 | 9년 전 | 420 | ||
| 8169 |
커네드커네드
|
9년 전 | 370 | |
| 8168 | 9년 전 | 457 | ||
| 8167 | 9년 전 | 447 | ||
| 8166 | 9년 전 | 347 | ||
| 8165 | 9년 전 | 285 | ||
| 8164 | 9년 전 | 417 | ||
| 8163 | 9년 전 | 420 | ||
| 8162 | 9년 전 | 403 | ||
| 8161 | 9년 전 | 422 | ||
| 8160 |
|
9년 전 | 640 | |
| 8159 | 9년 전 | 586 | ||
| 8158 | 9년 전 | 383 | ||
| 8157 | 9년 전 | 506 | ||
| 8156 | 9년 전 | 376 | ||
| 8155 | 9년 전 | 389 | ||
| 8154 |
00년생용띠
|
9년 전 | 709 | |
| 8153 | 9년 전 | 350 | ||
| 8152 |
|
9년 전 | 526 | |
| 8151 | 9년 전 | 520 | ||
| 8150 | 9년 전 | 637 | ||
| 8149 |
Jangfolk
|
9년 전 | 497 | |
| 8148 | 9년 전 | 310 | ||
| 8147 | 9년 전 | 495 | ||
| 8146 | 9년 전 | 576 | ||
| 8145 | 9년 전 | 535 | ||
| 8144 | 9년 전 | 503 | ||
| 8143 | 9년 전 | 327 | ||
| 8142 | 9년 전 | 548 | ||
| 8141 | 9년 전 | 488 | ||
| 8140 | 9년 전 | 1062 | ||
| 8139 | 9년 전 | 397 | ||
| 8138 |
전갈자리남자
|
9년 전 | 507 | |
| 8137 | 9년 전 | 547 | ||
| 8136 | 9년 전 | 873 | ||
| 8135 |
|
9년 전 | 922 | |
| 8134 |
PlayPixel
|
9년 전 | 663 | |
| 8133 |
|
9년 전 | 562 | |
| 8132 | 9년 전 | 593 | ||
| 8131 | 9년 전 | 953 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기