총계를 더욱 간단하게 하는 코딩???

총계를 더욱 간단하게 하는 코딩???

QA

총계를 더욱 간단하게 하는 코딩???

답변 2

본문

<?php  // 생산총계
    //생산 1 호기
$no01001 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVS2=31.0*227.0'");
$no01002 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVS2=32.0*226.4'");
$no01003 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVS2=32.0*251.0'");
$no01004 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVS2=32.0*259.0'");
$no01005 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVS2=34.0*249.0'");
$no01006 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVS2=34.0*269.0'");
$no01007 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVTiS2=33.0*256.0'");
$no01008 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVTiS2=35.0*273.8'");
$no01009 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S36CVTiS2=40.0*195.0'");
$no01010 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S70CVS1=41.0*180.0'");
$no01011 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*126.5'");
$no01012 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*133.1'");
$no01013 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*153.1'");
$no01014 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*162.0'");
$no01015 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*169.5'");
$no01016 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*168.7'");
$no01017 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=48.0*173.7'");
$no01018 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*79.1'");
$no01019 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*85.3'");
$no01020 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*88.8'");
$no01021 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*88.2'");
$no01022 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*91.16'");
$no01023 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*91.2'");
$no01024 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*93.1'");
$no01025 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*94.9'");
$no01026 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*97.6'");
$no01027 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*98.4'");
$no01028 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*100.7'");
$no01029 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*106.7'");
$no01030 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*103.8'");
$no01031 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*108.5'");
$no01032 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*108.7 ");
$no01033 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*112.9'");
$no01034 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*113.5'");
$no01035 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*116.1'");
$no01036 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*117.8'");
$no01037 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*121.2'");
$no01038 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*122.0'");
$no01039 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*122.8'");
$no01040 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*130.3'");
$no01041 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=55.0*134.9'");
$no01042 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=60.0*94.5'");
$no01043 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=60.0*100.6'");
$no01044 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=60.0*103.3'");
$no01045 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='S53CCF=60.0*109.7'");
$no01046 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1=48.0*181.0'");
$no01047 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1=48.0*187.1'");
$no01048 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1=55.0*82.8'");
$no01049 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1S=52.0*85.8'");
$no01050 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB=50.0*92.5'");
$no01051 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB=50.0*83.0'");
$no01052 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB=50.0*107.5'");
$no01053 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB=55.0*115.6'");
$no01054 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB=60.0*157.0'");
$no01055 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=45.0*100.9'");
$no01056 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=45.0*111.7'");
$no01057 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=55.0*172.4'");
$no01058 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=55.0*185.0'");
$no01059 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=55.0*191.7'");
$no01060 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=55.0*199.7'");
$no01061 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=55.0*210.2'");
$no01062 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=60.0*99.1'");
$no01063 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=60.0*110.8'");
$no01064 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=65.0*107.4'");
$no01065 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=65.0*108.1'");
$no01066 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=65.0*125.5'");
$no01067 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=65.0*130.4'");
$no01068 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI=65.0*140.6'");
$no01069 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=27.0*39.4'");
$no01070 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=29.0*41.9'");
$no01071 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=30.0*43.8'");
$no01072 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=32.0*44.2'");
$no01073 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=32.0*46.7'");
$no01074 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=32.0*47.2'");
$no01075 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=34.0*46.2'");
$no01076 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=34.0*47.0'");
$no01077 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=34.0*49.8'");
$no01078 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=34.0*53.6'");
$no01079 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=35.0*48.3'");
$no01080 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H_ST=36.5*56.0'");
$no01081 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1_ST=30.0*43.4'");
$no01082 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1_ST=34.0*41.8'");
$no01083 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1_ST=34.0*48.6'");
$no01084 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1_ST=36.0*51.3'");
$no01085 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420H1_ST=37.0*45.7'");
$no01086 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB_ST=28.0*256.7'");
$no01087 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB_ST=29.0*236.0'");
$no01088 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCR420HB_ST=29.0*239.1'");
$no01089 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM420H1_ST=30.5*46.4'");
$no01090 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM420H1_ST=36.0*49.9'");
$no01091 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=30.0*247.4'");
$no01092 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=30.0*256.0'");
$no01093 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=30.0*257.7'");
$no01094 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=30.0*269.4'");
$no01095 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=30.0*272.7'");
$no01096 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=33.0*231.5'");
$no01097 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=34.0*239.9'");
$no01098 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=34.0*247.6'");
$no01099 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='SCM920HVSI_ST=34.0*255.4'");
    //생산 2 호기
$no02001 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVS2=31.0*227.0'");
$no02002 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVS2=32.0*226.4'");
$no02003 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVS2=32.0*251.0'");
$no02004 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVS2=32.0*259.0'");
$no02005 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVS2=34.0*249.0'");
$no02006 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVS2=34.0*269.0'");
$no02007 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVTiS2=33.0*256.0'");
$no02008 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVTiS2=35.0*273.8'");
$no02009 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S36CVTiS2=40.0*195.0'");
$no02010 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S70CVS1=41.0*180.0'");
$no02011 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*126.5'");
$no02012 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*133.1'");
$no02013 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*153.1'");
$no02014 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*162.0'");
$no02015 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*169.5'");
$no02016 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*168.7'");
$no02017 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=48.0*173.7'");
$no02018 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*79.1'");
$no02019 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*85.3'");
$no02020 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*88.8'");
$no02021 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*88.2'");
$no02022 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*91.16'");
$no02023 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*91.2'");
$no02024 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*93.1'");
$no02025 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*94.9'");
$no02026 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*97.6'");
$no02027 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*98.4'");
$no02028 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*100.7'");
$no02029 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*106.7'");
$no02030 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*103.8'");
$no02031 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*108.5'");
$no02032 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*108.7 ");
$no02033 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*112.9'");
$no02034 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*113.5'");
$no02035 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*116.1'");
$no02036 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*117.8'");
$no02037 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*121.2'");
$no02038 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*122.0'");
$no02039 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*122.8'");
$no02040 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*130.3'");
$no02041 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=55.0*134.9'");
$no02042 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=60.0*94.5'");
$no02043 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=60.0*100.6'");
$no02044 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=60.0*103.3'");
$no02045 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='S53CCF=60.0*109.7'");
$no02046 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1=48.0*181.0'");
$no02047 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1=48.0*187.1'");
$no02048 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1=55.0*82.8'");
$no02049 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1S=52.0*85.8'");
$no02050 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB=50.0*92.5'");
$no02051 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB=50.0*83.0'");
$no02052 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB=50.0*107.5'");
$no02053 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB=55.0*115.6'");
$no02054 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB=60.0*157.0'");
$no02055 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=45.0*100.9'");
$no02056 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=45.0*111.7'");
$no02057 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=55.0*172.4'");
$no02058 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=55.0*185.0'");
$no02059 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=55.0*191.7'");
$no02060 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=55.0*199.7'");
$no02061 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=55.0*210.2'");
$no02062 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=60.0*99.1'");
$no02063 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=60.0*110.8'");
$no02064 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=65.0*107.4'");
$no02065 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=65.0*108.1'");
$no02066 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=65.0*125.5'");
$no02067 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=65.0*130.4'");
$no02068 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI=65.0*140.6'");
$no02069 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=27.0*39.4'");
$no02070 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=29.0*41.9'");
$no02071 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=30.0*43.8'");
$no02072 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=32.0*44.2'");
$no02073 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=32.0*46.7'");
$no02074 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=32.0*47.2'");
$no02075 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=34.0*46.2'");
$no02076 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=34.0*47.0'");
$no02077 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=34.0*49.8'");
$no02078 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=34.0*53.6'");
$no02079 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=35.0*48.3'");
$no02080 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H_ST=36.5*56.0'");
$no02081 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1_ST=30.0*43.4'");
$no02082 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1_ST=34.0*41.8'");
$no02083 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1_ST=34.0*48.6'");
$no02084 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1_ST=36.0*51.3'");
$no02085 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420H1_ST=37.0*45.7'");
$no02086 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB_ST=28.0*256.7'");
$no02087 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB_ST=29.0*236.0'");
$no02088 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCR420HB_ST=29.0*239.1'");
$no02089 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM420H1_ST=30.5*46.4'");
$no02090 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM420H1_ST=36.0*49.9'");
$no02091 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=30.0*247.4'");
$no02092 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=30.0*256.0'");
$no02093 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=30.0*257.7'");
$no02094 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=30.0*269.4'");
$no02095 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=30.0*272.7'");
$no02096 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=33.0*231.5'");
$no02097 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=34.0*239.9'");
$no02098 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=34.0*247.6'");
$no02099 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='SCM920HVSI_ST=34.0*255.4'");

        //합계수식
$no01 = $no01001 [sum_su1]+ $no02001 [sum_su1] ; // s36CVS2=31.0*227.0 ");
$no02 = $no01002 [sum_su1]+ $no02002 [sum_su1] ; // s36CVS2=32.0*226.4 ");
$no03 = $no01003 [sum_su1]+ $no02003 [sum_su1] ; // s36CVS2=32.0*251.0 ");
$no04 = $no01004 [sum_su1]+ $no02004 [sum_su1] ; // s36CVS2=32.0*259.0 ");
$no05 = $no01005 [sum_su1]+ $no02005 [sum_su1] ; // s36CVS2=34.0*249.0 ");
$no06 = $no01006 [sum_su1]+ $no02006 [sum_su1] ; // s36CVS2=34.0*269.0 ");
$no07 = $no01007 [sum_su1]+ $no02007 [sum_su1] ; // s36CVTiS2=33.0*256.0 ");
$no08 = $no01008 [sum_su1]+ $no02008 [sum_su1] ; // s36CVTiS2=35.0*273.8 ");
$no09 = $no01009 [sum_su1]+ $no02009 [sum_su1] ; // s36CVTiS2=40.0*195.0 ");
$no10 = $no01010 [sum_su1]+ $no02010 [sum_su1] ; // S70CVS1=41.0*180.0 ");
$no11 = $no01011 [sum_su1]+ $no02011 [sum_su1] ; // S53CCF=48.0*126.5 ");
$no12 = $no01012 [sum_su1]+ $no02012 [sum_su1] ; // S53CCF=48.0*133.1 ");
$no13 = $no01013 [sum_su1]+ $no02013 [sum_su1] ; // S53CCF=48.0*153.1 ");
$no14 = $no01014 [sum_su1]+ $no02014 [sum_su1] ; // S53CCF=48.0*162.0 ");
$no15 = $no01015 [sum_su1]+ $no02015 [sum_su1] ; // S53CCF=48.0*169.5 ");
$no16 = $no01016 [sum_su1]+ $no02016 [sum_su1] ; // S53CCF=48.0*168.7 ");
$no17 = $no01017 [sum_su1]+ $no02017 [sum_su1] ; // S53CCF=48.0*173.7 ");
$no18 = $no01018 [sum_su1]+ $no02018 [sum_su1] ; // S53CCF=55.0*79.1 ");
$no19 = $no01019 [sum_su1]+ $no02019 [sum_su1] ; // S53CCF=55.0*85.3 ");
$no20 = $no01020 [sum_su1]+ $no02020 [sum_su1] ; // S53CCF=55.0*88.8 ");
$no21 = $no01021 [sum_su1]+ $no02021 [sum_su1] ; // S53CCF=55.0*88.2 ");
$no22 = $no01022 [sum_su1]+ $no02022 [sum_su1] ; // S53CCF=55.0*91.16 ");
$no23 = $no01023 [sum_su1]+ $no02023 [sum_su1] ; // S53CCF=55.0*91.2 ");
$no24 = $no01024 [sum_su1]+ $no02024 [sum_su1] ; // S53CCF=55.0*93.1 ");
$no25 = $no01025 [sum_su1]+ $no02025 [sum_su1] ; // S53CCF=55.0*94.9 ");
$no26 = $no01026 [sum_su1]+ $no02026 [sum_su1] ; // S53CCF=55.0*97.6 ");
$no27 = $no01027 [sum_su1]+ $no02027 [sum_su1] ; // S53CCF=55.0*98.4 ");
$no28 = $no01028 [sum_su1]+ $no02028 [sum_su1] ; // S53CCF=55.0*100.7 ");
$no29 = $no01029 [sum_su1]+ $no02029 [sum_su1] ; // S53CCF=55.0*106.7 ");
$no30 = $no01030 [sum_su1]+ $no02030 [sum_su1] ; // S53CCF=55.0*103.8 ");
$no31 = $no01031 [sum_su1]+ $no02031 [sum_su1] ; // S53CCF=55.0*108.5 ");
$no32 = $no01032 [sum_su1]+ $no02032 [sum_su1] ; // S53CCF=55.0*108.7 ");
$no33 = $no01033 [sum_su1]+ $no02033 [sum_su1] ; // S53CCF=55.0*112.9 ");
$no34 = $no01034 [sum_su1]+ $no02034 [sum_su1] ; // S53CCF=55.0*113.5 ");
$no35 = $no01035 [sum_su1]+ $no02035 [sum_su1] ; // S53CCF=55.0*116.1 ");
$no36 = $no01036 [sum_su1]+ $no02036 [sum_su1] ; // S53CCF=55.0*117.8 ");
$no37 = $no01037 [sum_su1]+ $no02037 [sum_su1] ; // S53CCF=55.0*121.2 ");
$no38 = $no01038 [sum_su1]+ $no02038 [sum_su1] ; // S53CCF=55.0*122.0 ");
$no39 = $no01039 [sum_su1]+ $no02039 [sum_su1] ; // S53CCF=55.0*122.8 ");
$no40 = $no01040 [sum_su1]+ $no02040 [sum_su1] ; // S53CCF=55.0*130.3 ");
$no41 = $no01041 [sum_su1]+ $no02041 [sum_su1] ; // S53CCF=55.0*134.9 ");
$no42 = $no01042 [sum_su1]+ $no02042 [sum_su1] ; // S53CCF=60.0*94.5 ");
$no43 = $no01043 [sum_su1]+ $no02043 [sum_su1] ; // S53CCF=60.0*100.6 ");
$no44 = $no01044 [sum_su1]+ $no02044 [sum_su1] ; // S53CCF=60.0*103.3 ");
$no45 = $no01045 [sum_su1]+ $no02045 [sum_su1] ; // S53CCF=60.0*109.7 ");
$no46 = $no01046 [sum_su1]+ $no02046 [sum_su1] ; // SCR420H1=48.0*181.0 ");
$no47 = $no01047 [sum_su1]+ $no02047 [sum_su1] ; // SCR420H1=48.0*187.1 ");
$no48 = $no01048 [sum_su1]+ $no02048 [sum_su1] ; // SCR420H1=55.0*82.8 ");
$no49 = $no01049 [sum_su1]+ $no02049 [sum_su1] ; // SCR420H1S=52.0*85.8 ");
$no50 = $no01050 [sum_su1]+ $no02050 [sum_su1] ; // SCR420HB=50.0*92.5 ");
$no51 = $no01051 [sum_su1]+ $no02051 [sum_su1] ; // SCR420HB=50.0*83.0 ");
$no52 = $no01052 [sum_su1]+ $no02052 [sum_su1] ; // SCR420HB=50.0*107.5 ");
$no53 = $no01053 [sum_su1]+ $no02053 [sum_su1] ; // SCR420HB=55.0*115.6 ");
$no54 = $no01054 [sum_su1]+ $no02054 [sum_su1] ; // SCR420HB=60.0*157.0 ");
$no55 = $no01055 [sum_su1]+ $no02055 [sum_su1] ; // SCM920HVSI=45.0*100.9 ");
$no56 = $no01056 [sum_su1]+ $no02056 [sum_su1] ; // SCM920HVSI=45.0*111.7 ");
$no57 = $no01057 [sum_su1]+ $no02057 [sum_su1] ; // SCM920HVSI=55.0*172.4 ");
$no58 = $no01058 [sum_su1]+ $no02058 [sum_su1] ; // SCM920HVSI=55.0*185.0 ");
$no59 = $no01059 [sum_su1]+ $no02059 [sum_su1] ; // SCM920HVSI=55.0*191.7 ");
$no60 = $no01060 [sum_su1]+ $no02060 [sum_su1] ; // SCM920HVSI=55.0*199.7 ");
$no61 = $no01061 [sum_su1]+ $no02061 [sum_su1] ; // SCM920HVSI=55.0*210.2 ");
$no62 = $no01062 [sum_su1]+ $no02062 [sum_su1] ; // SCM920HVSI=60.0*99.1 ");
$no63 = $no01063 [sum_su1]+ $no02063 [sum_su1] ; // SCM920HVSI=60.0*110.8 ");
$no64 = $no01064 [sum_su1]+ $no02064 [sum_su1] ; // SCM920HVSI=65.0*107.4 ");
$no65 = $no01065 [sum_su1]+ $no02065 [sum_su1] ; // SCM920HVSI=65.0*108.1 ");
$no66 = $no01066 [sum_su1]+ $no02066 [sum_su1] ; // SCM920HVSI=65.0*125.5 ");
$no67 = $no01067 [sum_su1]+ $no02067 [sum_su1] ; // SCM920HVSI=65.0*130.4 ");
$no68 = $no01068 [sum_su1]+ $no02068 [sum_su1] ; // SCM920HVSI=65.0*140.6 ");
$no69 = $no01069 [sum_su1]+ $no02069 [sum_su1] ; // SCR420H_ST=27.0*39.4 ");
$no70 = $no01070 [sum_su1]+ $no02070 [sum_su1] ; // SCR420H_ST=29.0*41.9 ");
$no71 = $no01071 [sum_su1]+ $no02071 [sum_su1] ; // SCR420H_ST=30.0*43.8 ");
$no72 = $no01072 [sum_su1]+ $no02072 [sum_su1] ; // SCR420H_ST=32.0*44.2 ");
$no73 = $no01073 [sum_su1]+ $no02073 [sum_su1] ; // SCR420H_ST=32.0*46.7 ");
$no74 = $no01074 [sum_su1]+ $no02074 [sum_su1] ; // SCR420H_ST=32.0*47.2 ");
$no75 = $no01075 [sum_su1]+ $no02075 [sum_su1] ; // SCR420H_ST=34.0*46.2 ");
$no76 = $no01076 [sum_su1]+ $no02076 [sum_su1] ; // SCR420H_ST=34.0*47.0 ");
$no77 = $no01077 [sum_su1]+ $no02077 [sum_su1] ; // SCR420H_ST=34.0*49.8 ");
$no78 = $no01078 [sum_su1]+ $no02078 [sum_su1] ; // SCR420H_ST=34.0*53.6 ");
$no79 = $no01079 [sum_su1]+ $no02079 [sum_su1] ; // SCR420H_ST=35.0*48.3 ");
$no80 = $no01080 [sum_su1]+ $no02080 [sum_su1] ; // SCR420H_ST=36.5*56.0 ");
$no81 = $no01081 [sum_su1]+ $no02081 [sum_su1] ; // SCR420H1_ST=30.0*43.4 ");
$no82 = $no01082 [sum_su1]+ $no02082 [sum_su1] ; // SCR420H1_ST=34.0*41.8 ");
$no83 = $no01083 [sum_su1]+ $no02083 [sum_su1] ; // SCR420H1_ST=34.0*48.6 ");
$no84 = $no01084 [sum_su1]+ $no02084 [sum_su1] ; // SCR420H1_ST=36.0*51.3 ");
$no85 = $no01085 [sum_su1]+ $no02085 [sum_su1] ; // SCR420H1_ST=37.0*45.7 ");
$no86 = $no01086 [sum_su1]+ $no02086 [sum_su1] ; // SCR420HB_ST=28.0*256.7 ");
$no87 = $no01087 [sum_su1]+ $no02087 [sum_su1] ; // SCR420HB_ST=29.0*236.0 ");
$no88 = $no01088 [sum_su1]+ $no02088 [sum_su1] ; // SCR420HB_ST=29.0*239.1 ");
$no89 = $no01089 [sum_su1]+ $no02089 [sum_su1] ; // SCM420H1_ST=30.5*46.4 ");
$no90 = $no01090 [sum_su1]+ $no02090 [sum_su1] ; // SCM420H1_ST=36.0*49.9 ");
$no91 = $no01091 [sum_su1]+ $no02091 [sum_su1] ; // SCM920HVSI_ST=30.0*247.4 ");
$no92 = $no01092 [sum_su1]+ $no02092 [sum_su1] ; // SCM920HVSI_ST=30.0*256.0 ");
$no93 = $no01093 [sum_su1]+ $no02093 [sum_su1] ; // SCM920HVSI_ST=30.0*257.7 ");
$no94 = $no01094 [sum_su1]+ $no02094 [sum_su1] ; // SCM920HVSI_ST=30.0*269.4 ");
$no95 = $no01095 [sum_su1]+ $no02095 [sum_su1] ; // SCM920HVSI_ST=30.0*272.7 ");
$no96 = $no01096 [sum_su1]+ $no02096 [sum_su1] ; // SCM920HVSI_ST=33.0*231.5 ");
$no97 = $no01097 [sum_su1]+ $no02097 [sum_su1] ; // SCM920HVSI_ST=34.0*239.9 ");
$no98 = $no01098 [sum_su1]+ $no02098 [sum_su1] ; // SCM920HVSI_ST=34.0*247.6 ");
$no99 = $no01099 [sum_su1]+ $no02099 [sum_su1] ; // SCM920HVSI_ST=34.0*255.4 ");

?>
 

위소스 까지 구현하여 품명별 생산합계를 구했으나...

좀더 간단한 코딩이 있을까 하여 질문을 올립니다.

고수분들의 도움을 간절히 기다립니다. ~~ ^;^

이 질문에 댓글 쓰기 :

답변 2

아래와 같이 한번 해보세요

단 오류가 있을수 있습니다

------------------------------------------------------------------------------------------------------

 


$noAry = array('S36CVS2=31.0*227.0','S36CVS2=32.0*226.4','S36CVS2=32.0*251.0','S36CVS2=32.0*259.0','S36CVS2=34.0*249.0','S36CVS2=34.0*269.0','S36CVTiS2=33.0*256.0','S36CVTiS2=35.0*273.8','S36CVTiS2=40.0*195.0','S70CVS1=41.0*180.0','S53CCF=48.0*126.5','S53CCF=48.0*133.1','S53CCF=48.0*153.1','S53CCF=48.0*162.0','S53CCF=48.0*169.5','S53CCF=48.0*168.7','S53CCF=48.0*173.7','S53CCF=55.0*79.1','S53CCF=55.0*85.3','S53CCF=55.0*88.8','S53CCF=55.0*88.2','S53CCF=55.0*91.16','S53CCF=55.0*91.2','S53CCF=55.0*93.1','S53CCF=55.0*94.9','S53CCF=55.0*97.6','S53CCF=55.0*98.4','S53CCF=55.0*100.7','S53CCF=55.0*106.7','S53CCF=55.0*103.8','S53CCF=55.0*108.5','S53CCF=55.0*108.7','S53CCF=55.0*112.9','S53CCF=55.0*113.5','S53CCF=55.0*116.1','S53CCF=55.0*117.8','S53CCF=55.0*121.2','S53CCF=55.0*122.0','S53CCF=55.0*122.8','S53CCF=55.0*130.3','S53CCF=55.0*134.9','S53CCF=60.0*94.5','S53CCF=60.0*100.6','S53CCF=60.0*103.3','S53CCF=60.0*109.7','SCR420H1=48.0*181.0','SCR420H1=48.0*187.1','SCR420H1=55.0*82.8','SCR420H1S=52.0*85.8','SCR420HB=50.0*92.5','SCR420HB=50.0*83.0','SCR420HB=50.0*107.5','SCR420HB=55.0*115.6','SCR420HB=60.0*157.0','SCM920HVSI=45.0*100.9','SCM920HVSI=45.0*111.7','SCM920HVSI=55.0*172.4','SCM920HVSI=55.0*185.0','SCM920HVSI=55.0*191.7','SCM920HVSI=55.0*199.7','SCM920HVSI=55.0*210.2','SCM920HVSI=60.0*99.1','SCM920HVSI=60.0*110.8','SCM920HVSI=65.0*107.4','SCM920HVSI=65.0*108.1','SCM920HVSI=65.0*125.5','SCM920HVSI=65.0*130.4','SCM920HVSI=65.0*140.6','SCR420H_ST=27.0*39.4','SCR420H_ST=29.0*41.9','SCR420H_ST=30.0*43.8','SCR420H_ST=32.0*44.2','SCR420H_ST=32.0*46.7','SCR420H_ST=32.0*47.2','SCR420H_ST=34.0*46.2','SCR420H_ST=34.0*47.0','SCR420H_ST=34.0*49.8','SCR420H_ST=34.0*53.6','SCR420H_ST=35.0*48.3','SCR420H_ST=36.5*56.0','SCR420H1_ST=30.0*43.4','SCR420H1_ST=34.0*41.8','SCR420H1_ST=34.0*48.6','SCR420H1_ST=36.0*51.3','SCR420H1_ST=37.0*45.7','SCR420HB_ST=28.0*256.7','SCR420HB_ST=29.0*236.0','SCR420HB_ST=29.0*239.1','SCM420H1_ST=30.5*46.4','SCM420H1_ST=36.0*49.9','SCM920HVSI_ST=30.0*247.4','SCM920HVSI_ST=30.0*256.0','SCM920HVSI_ST=30.0*257.7','SCM920HVSI_ST=30.0*269.4','SCM920HVSI_ST=30.0*272.7','SCM920HVSI_ST=33.0*231.5','SCM920HVSI_ST=34.0*239.9','SCM920HVSI_ST=34.0*247.6','SCM920HVSI_ST=34.0*255.4');

 

 

 


//합계
for($i=1; $i<=99; $i++){
    if($i<10) $_i ='0'.$i;
    else      $_i = $i;
    //생산 1호기
    $sumAry1 = sql_fetch("select sum(wr_41) as sum_su1 from $write_table where wr_1='".$noAry[$i]."'");
    //생산 2호기
    $sumAry2 = sql_fetch("select sum(wr_42) as sum_su1 from $write_table where wr_2='".$noAry[$i]."'");
    //합계 수식
    $no{$_i} = $sumAry1['sum_su1'] + $sumAry2['sum_su1'];
}

echo $no01;
echo $no10;
echo $no99;

 

 

------------------------------------------------------------------------------------------------

 

위의 요지는

수식에 필요한 WHERE절 부분만 배열을 만들어서 배열에 순차적으로 넣고

for문을 이용해서 where절에 집어 넣습니다

 

$no{$i}  => 가변변수를 사용해서 변수지정을 합니다

 

그리고 전과 같이 변수명으로 ( $no01 ~ $no99 ) 불러다 씁니다

 

 

 

 

동일한 패턴이 wr_41 과  wr_42의 1번부터 99 번째까지가 각각 동일하게 대입되고

각 순번의 매칭되는 결과값끼리 합산을 하는 방법으로 처리합니다.

 

각각 차이가 있는 값은 db 혹은 배열변수로 동일구조로 구성합니다.

db접속을 각 1회씩만 수행하여 99번만 수행하도록 줄여서 처리해봅니다.

 


<?php 
    //생산 1 호기, 2호기 대입변수=>배열로 순번지정
$values = array(
    '01' => 'S36CVS2=31.0*227.0',
    '02' => 'S36CVS2=32.0*226.4',
    '03' => 'S36CVS2=32.0*251.0',
    '04' => 'S36CVS2=32.0*259.0',
    '05' => 'S36CVS2=34.0*249.0',
    '06' => 'S36CVS2=34.0*269.0',
    '07' => 'S36CVTiS2=33.0*256.0',
    '08' => 'S36CVTiS2=35.0*273.8',
    '09' => 'S36CVTiS2=40.0*195.0',
    '10' => 'S70CVS1=41.0*180.0',
    '11' => 'S53CCF=48.0*126.5',
    '12' => 'S53CCF=48.0*133.1',
    '13' => 'S53CCF=48.0*153.1',
    '14' => 'S53CCF=48.0*162.0',
    '15' => 'S53CCF=48.0*169.5',
    '16' => 'S53CCF=48.0*168.7',
    '17' => 'S53CCF=48.0*173.7',
    '18' => 'S53CCF=55.0*79.1',
    '19' => 'S53CCF=55.0*85.3',
    '20' => 'S53CCF=55.0*88.8',
    '21' => 'S53CCF=55.0*88.2',
    '22' => 'S53CCF=55.0*91.16',
    '23' => 'S53CCF=55.0*91.2',
    '24' => 'S53CCF=55.0*93.1',
    '25' => 'S53CCF=55.0*94.9',
    '26' => 'S53CCF=55.0*97.6',
    '27' => 'S53CCF=55.0*98.4',
    '28' => 'S53CCF=55.0*100.7',
    '29' => 'S53CCF=55.0*106.7',
    '30' => 'S53CCF=55.0*103.8',
    '31' => 'S53CCF=55.0*108.5',
    '32' => 'S53CCF=55.0*108.7 ',
    '33' => 'S53CCF=55.0*112.9',
    '34' => 'S53CCF=55.0*113.5',
    '35' => 'S53CCF=55.0*116.1',
    '36' => 'S53CCF=55.0*117.8',
    '37' => 'S53CCF=55.0*121.2',
    '38' => 'S53CCF=55.0*122.0',
    '39' => 'S53CCF=55.0*122.8',
    '40' => 'S53CCF=55.0*130.3',
    '41' => 'S53CCF=55.0*134.9',
    '42' => 'S53CCF=60.0*94.5',
    '43' => 'S53CCF=60.0*100.6',
    '44' => 'S53CCF=60.0*103.3',
    '45' => 'S53CCF=60.0*109.7',
    '46' => 'SCR420H1=48.0*181.0',
    '47' => 'SCR420H1=48.0*187.1',
    '48' => 'SCR420H1=55.0*82.8',
    '49' => 'SCR420H1S=52.0*85.8',
    '50' => 'SCR420HB=50.0*92.5',
    '51' => 'SCR420HB=50.0*83.0',
    '52' => 'SCR420HB=50.0*107.5',
    '53' => 'SCR420HB=55.0*115.6',
    '54' => 'SCR420HB=60.0*157.0',
    '55' => 'SCM920HVSI=45.0*100.9',
    '56' => 'SCM920HVSI=45.0*111.7',
    '57' => 'SCM920HVSI=55.0*172.4',
    '58' => 'SCM920HVSI=55.0*185.0',
    '59' => 'SCM920HVSI=55.0*191.7',
    '60' => 'SCM920HVSI=55.0*199.7',
    '61' => 'SCM920HVSI=55.0*210.2',
    '62' => 'SCM920HVSI=60.0*99.1',
    '63' => 'SCM920HVSI=60.0*110.8',
    '64' => 'SCM920HVSI=65.0*107.4',
    '65' => 'SCM920HVSI=65.0*108.1',
    '66' => 'SCM920HVSI=65.0*125.5',
    '67' => 'SCM920HVSI=65.0*130.4',
    '68' => 'SCM920HVSI=65.0*140.6',
    '69' => 'SCR420H_ST=27.0*39.4',
    '70' => 'SCR420H_ST=29.0*41.9',
    '71' => 'SCR420H_ST=30.0*43.8',
    '72' => 'SCR420H_ST=32.0*44.2',
    '73' => 'SCR420H_ST=32.0*46.7',
    '74' => 'SCR420H_ST=32.0*47.2',
    '75' => 'SCR420H_ST=34.0*46.2',
    '76' => 'SCR420H_ST=34.0*47.0',
    '77' => 'SCR420H_ST=34.0*49.8',
    '78' => 'SCR420H_ST=34.0*53.6',
    '79' => 'SCR420H_ST=35.0*48.3',
    '80' => 'SCR420H_ST=36.5*56.0',
    '81' => 'SCR420H1_ST=30.0*43.4',
    '82' => 'SCR420H1_ST=34.0*41.8',
    '83' => 'SCR420H1_ST=34.0*48.6',
    '84' => 'SCR420H1_ST=36.0*51.3',
    '85' => 'SCR420H1_ST=37.0*45.7',
    '86' => 'SCR420HB_ST=28.0*256.7',
    '87' => 'SCR420HB_ST=29.0*236.0',
    '88' => 'SCR420HB_ST=29.0*239.1',
    '89' => 'SCM420H1_ST=30.5*46.4',
    '90' => 'SCM420H1_ST=36.0*49.9',
    '91' => 'SCM920HVSI_ST=30.0*247.4',
    '92' => 'SCM920HVSI_ST=30.0*256.0',
    '93' => 'SCM920HVSI_ST=30.0*257.7',
    '94' => 'SCM920HVSI_ST=30.0*269.4',
    '95' => 'SCM920HVSI_ST=30.0*272.7',
    '96' => 'SCM920HVSI_ST=33.0*231.5',
    '97' => 'SCM920HVSI_ST=34.0*239.9',
    '98' => 'SCM920HVSI_ST=34.0*247.6',
    '99' => 'SCM920HVSI_ST=34.0*255.4',
);
$nos = array();
foreach($values as $key => $value) {
    $sql = " SELECT ((select sum(wr_41)  from $write_table where wr_1='{$value}') + 
                    (select sum(wr_42)  from $write_table where wr_2='{$value}')) nval ";
    $nos[$key] = sql_fetch($sql)['nval']; // db접속은 최소한으로  
}
print_r2($nos);  // 필요한 변수는 배열의 첨자값으로 사용합니다.
echo $nos['01']. " ~ ".$nos['99'];
?>
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 61,339
© SIRSOFT
현재 페이지 제일 처음으로