<?
$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년 전
정말 감사합니다!!! 많은 도움이 되었어요!! ㅠㅠ
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4730 |
제너레이션
|
13년 전 | 1005 | |
| 4729 | 13년 전 | 949 | ||
| 4728 | 13년 전 | 705 | ||
| 4727 | 13년 전 | 1248 | ||
| 4726 | 13년 전 | 854 | ||
| 4725 | 13년 전 | 1686 | ||
| 4724 | 13년 전 | 1022 | ||
| 4723 | 13년 전 | 2693 | ||
| 4722 | 13년 전 | 564 | ||
| 4721 |
ECEditor
|
13년 전 | 2235 | |
| 4720 | 13년 전 | 2619 | ||
| 4719 | 13년 전 | 4389 | ||
| 4718 | 13년 전 | 963 | ||
| 4717 | 13년 전 | 1178 | ||
| 4716 | 13년 전 | 1355 | ||
| 4715 |
한번잘해보자
|
13년 전 | 1172 | |
| 4714 | 13년 전 | 1179 | ||
| 4713 | 13년 전 | 2827 | ||
| 4712 | 13년 전 | 1251 | ||
| 4711 |
김준수사랑
|
13년 전 | 1015 | |
| 4710 |
한번잘해보자
|
13년 전 | 1149 | |
| 4709 | 13년 전 | 1147 | ||
| 4708 | 13년 전 | 825 | ||
| 4707 | 13년 전 | 1706 | ||
| 4706 |
프로프리랜서
|
13년 전 | 2092 | |
| 4705 |
프로프리랜서
|
13년 전 | 1381 | |
| 4704 | 13년 전 | 969 | ||
| 4703 |
프로프리랜서
|
13년 전 | 936 | |
| 4702 | 13년 전 | 836 | ||
| 4701 | 13년 전 | 1572 | ||
| 4700 | 13년 전 | 2603 | ||
| 4699 | 13년 전 | 1313 | ||
| 4698 |
|
13년 전 | 1604 | |
| 4697 |
|
13년 전 | 1120 | |
| 4696 |
|
13년 전 | 1138 | |
| 4695 |
|
13년 전 | 1347 | |
| 4694 |
|
13년 전 | 866 | |
| 4693 |
|
13년 전 | 856 | |
| 4692 |
|
13년 전 | 861 | |
| 4691 |
|
13년 전 | 1186 | |
| 4690 |
|
13년 전 | 1273 | |
| 4689 |
|
13년 전 | 1022 | |
| 4688 |
|
13년 전 | 780 | |
| 4687 |
|
13년 전 | 1055 | |
| 4686 |
|
13년 전 | 1010 | |
| 4685 |
|
13년 전 | 943 | |
| 4684 |
|
13년 전 | 1043 | |
| 4683 |
|
13년 전 | 933 | |
| 4682 |
|
13년 전 | 1245 | |
| 4681 |
|
13년 전 | 1022 | |
| 4680 |
|
13년 전 | 1145 | |
| 4679 |
|
13년 전 | 1654 | |
| 4678 |
|
13년 전 | 583 | |
| 4677 | 13년 전 | 2916 | ||
| 4676 |
복이219
|
13년 전 | 622 | |
| 4675 | 13년 전 | 818 | ||
| 4674 | 13년 전 | 614 | ||
| 4673 | 13년 전 | 992 | ||
| 4672 | 13년 전 | 935 | ||
| 4671 | 13년 전 | 1201 | ||
| 4670 | 13년 전 | 718 | ||
| 4669 | 13년 전 | 1779 | ||
| 4668 | 13년 전 | 1421 | ||
| 4667 |
너는나의봄이다
|
13년 전 | 1023 | |
| 4666 | 13년 전 | 6703 | ||
| 4665 | 13년 전 | 629 | ||
| 4664 | 13년 전 | 1003 | ||
| 4663 | 13년 전 | 848 | ||
| 4662 | 13년 전 | 977 | ||
| 4661 | 13년 전 | 1246 | ||
| 4660 | 13년 전 | 847 | ||
| 4659 | 13년 전 | 1105 | ||
| 4658 |
소나무닷컴
|
13년 전 | 693 | |
| 4657 | 13년 전 | 713 | ||
| 4656 |
|
13년 전 | 1244 | |
| 4655 | 13년 전 | 3101 | ||
| 4654 | 13년 전 | 677 | ||
| 4653 | 13년 전 | 2103 | ||
| 4652 | 13년 전 | 875 | ||
| 4651 | 13년 전 | 779 | ||
| 4650 | 13년 전 | 1671 | ||
| 4649 | 13년 전 | 1603 | ||
| 4648 | 13년 전 | 615 | ||
| 4647 | 13년 전 | 1512 | ||
| 4646 | 13년 전 | 1937 | ||
| 4645 | 13년 전 | 1337 | ||
| 4644 | 13년 전 | 612 | ||
| 4643 | 13년 전 | 2030 | ||
| 4642 | 13년 전 | 825 | ||
| 4641 |
|
13년 전 | 609 | |
| 4640 | 13년 전 | 570 | ||
| 4639 |
|
13년 전 | 1296 | |
| 4638 |
|
13년 전 | 1666 | |
| 4637 |
|
13년 전 | 1137 | |
| 4636 | 13년 전 | 634 | ||
| 4635 | 13년 전 | 764 | ||
| 4634 | 13년 전 | 1272 | ||
| 4633 | 13년 전 | 1245 | ||
| 4632 |
|
13년 전 | 548 | |
| 4631 | 13년 전 | 3344 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기