<?
$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년 전
정말 감사합니다!!! 많은 도움이 되었어요!! ㅠㅠ
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5952 | 9년 전 | 245 | ||
| 5951 | 9년 전 | 183 | ||
| 5950 | 9년 전 | 260 | ||
| 5949 | 9년 전 | 410 | ||
| 5948 | 9년 전 | 164 | ||
| 5947 | 9년 전 | 182 | ||
| 5946 | 9년 전 | 170 | ||
| 5945 | 9년 전 | 322 | ||
| 5944 | 9년 전 | 321 | ||
| 5943 | 9년 전 | 400 | ||
| 5942 | 9년 전 | 329 | ||
| 5941 | 9년 전 | 515 | ||
| 5940 | 9년 전 | 413 | ||
| 5939 | 9년 전 | 353 | ||
| 5938 |
씨에이치넷
|
9년 전 | 1264 | |
| 5937 | 9년 전 | 378 | ||
| 5936 | 9년 전 | 343 | ||
| 5935 | 9년 전 | 332 | ||
| 5934 | 9년 전 | 268 | ||
| 5933 | 9년 전 | 692 | ||
| 5932 | 9년 전 | 258 | ||
| 5931 | 9년 전 | 280 | ||
| 5930 | 9년 전 | 472 | ||
| 5929 | 9년 전 | 271 | ||
| 5928 | 9년 전 | 318 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기