<?
$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년 전
정말 감사합니다!!! 많은 도움이 되었어요!! ㅠㅠ
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5030 | 13년 전 | 772 | ||
| 5029 | 13년 전 | 458 | ||
| 5028 | 13년 전 | 712 | ||
| 5027 | 13년 전 | 1302 | ||
| 5026 | 13년 전 | 534 | ||
| 5025 | 13년 전 | 1340 | ||
| 5024 | 13년 전 | 405 | ||
| 5023 | 13년 전 | 647 | ||
| 5022 | 13년 전 | 413 | ||
| 5021 | 13년 전 | 652 | ||
| 5020 | 13년 전 | 500 | ||
| 5019 | 13년 전 | 843 | ||
| 5018 | 13년 전 | 894 | ||
| 5017 | 13년 전 | 777 | ||
| 5016 | 13년 전 | 2622 | ||
| 5015 | 13년 전 | 401 | ||
| 5014 | 13년 전 | 665 | ||
| 5013 | 13년 전 | 570 | ||
| 5012 |
JacobJeon
|
13년 전 | 1061 | |
| 5011 | 13년 전 | 792 | ||
| 5010 | 13년 전 | 1432 | ||
| 5009 |
JacobJeon
|
13년 전 | 1783 | |
| 5008 | 13년 전 | 1129 | ||
| 5007 | 13년 전 | 3001 | ||
| 5006 |
|
13년 전 | 1279 | |
| 5005 | 13년 전 | 656 | ||
| 5004 | 13년 전 | 2075 | ||
| 5003 | 13년 전 | 2514 | ||
| 5002 | 13년 전 | 375 | ||
| 5001 | 13년 전 | 513 | ||
| 5000 | 13년 전 | 409 | ||
| 4999 | 13년 전 | 509 | ||
| 4998 | 13년 전 | 452 | ||
| 4997 | 13년 전 | 648 | ||
| 4996 | 13년 전 | 1897 | ||
| 4995 | 13년 전 | 374 | ||
| 4994 | 13년 전 | 371 | ||
| 4993 | 13년 전 | 515 | ||
| 4992 | 13년 전 | 481 | ||
| 4991 | 13년 전 | 374 | ||
| 4990 | 13년 전 | 690 | ||
| 4989 | 13년 전 | 630 | ||
| 4988 | 13년 전 | 384 | ||
| 4987 | 13년 전 | 400 | ||
| 4986 | 13년 전 | 1367 | ||
| 4985 | 13년 전 | 646 | ||
| 4984 | 13년 전 | 1030 | ||
| 4983 | 13년 전 | 401 | ||
| 4982 |
쥬드125
|
13년 전 | 997 | |
| 4981 | 13년 전 | 525 | ||
| 4980 | 13년 전 | 390 | ||
| 4979 | 13년 전 | 657 | ||
| 4978 | 13년 전 | 2160 | ||
| 4977 |
atria
|
13년 전 | 838 | |
| 4976 | 13년 전 | 1511 | ||
| 4975 | 13년 전 | 419 | ||
| 4974 | 13년 전 | 445 | ||
| 4973 | 13년 전 | 696 | ||
| 4972 | 13년 전 | 455 | ||
| 4971 | 13년 전 | 1383 | ||
| 4970 | 13년 전 | 350 | ||
| 4969 | 13년 전 | 398 | ||
| 4968 | 13년 전 | 712 | ||
| 4967 | 13년 전 | 507 | ||
| 4966 | 13년 전 | 429 | ||
| 4965 | 13년 전 | 572 | ||
| 4964 | 13년 전 | 574 | ||
| 4963 | 13년 전 | 415 | ||
| 4962 | 13년 전 | 2223 | ||
| 4961 | 13년 전 | 1316 | ||
| 4960 | 13년 전 | 1212 | ||
| 4959 | 13년 전 | 408 | ||
| 4958 | 13년 전 | 377 | ||
| 4957 | 13년 전 | 460 | ||
| 4956 | 13년 전 | 695 | ||
| 4955 | 13년 전 | 489 | ||
| 4954 | 13년 전 | 1056 | ||
| 4953 | 13년 전 | 1148 | ||
| 4952 | 13년 전 | 735 | ||
| 4951 |
sjsmsrjfflauswnrsmse
|
13년 전 | 864 | |
| 4950 | 13년 전 | 1898 | ||
| 4949 | 13년 전 | 2213 | ||
| 4948 | 13년 전 | 5518 | ||
| 4947 | 13년 전 | 406 | ||
| 4946 | 13년 전 | 848 | ||
| 4945 | 13년 전 | 400 | ||
| 4944 | 13년 전 | 604 | ||
| 4943 |
마당쇠2000
|
13년 전 | 1255 | |
| 4942 |
cula100jak
|
13년 전 | 823 | |
| 4941 | 13년 전 | 468 | ||
| 4940 | 13년 전 | 564 | ||
| 4939 | 13년 전 | 397 | ||
| 4938 | 13년 전 | 543 | ||
| 4937 | 13년 전 | 1474 | ||
| 4936 |
techer
|
13년 전 | 1812 | |
| 4935 | 13년 전 | 704 | ||
| 4934 | 13년 전 | 929 | ||
| 4933 | 13년 전 | 2021 | ||
| 4932 |
kajama78
|
13년 전 | 936 | |
| 4931 | 13년 전 | 975 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기