1. PHP / Говнокод #5862

    +163

    1. 1
    2. 2
    3. 3
    4. 4
    $str="'".trim(iconv("cp866","UTF-8",$row['P_NOMER']))."','".trim(iconv("cp866","UTF-8",$row['P_DATA']))."','".trim(iconv("cp866","UTF-8",$row['V_NOMER']))."','".trim(iconv("cp866","UTF-8",$row['V_DATA']))."','".trim(iconv("cp866","UTF-8",$row['PL_NOMER']))."','".trim(iconv("cp866","UTF-8",$row['PL_DATA']))."',".$row['PL_SUMMA'].",'".trim(iconv("cp866","UTF-8",$row['SODER']))."','".trim(iconv("cp866","UTF-8",$row['NA_SOGL']))."','".trim(iconv("cp866","UTF-8",$row['N_RAY']))."','".trim(iconv("cp866","UTF-8",$row['KOD_PRED']))."','".trim(iconv("cp866","UTF-8",$row['NAME_1']))."','".trim(iconv("cp866","UTF-8",$row['TIP_TY']))."','".trim(iconv("cp866","UTF-8",$row['KOD_TY']))."','".trim(iconv("cp866","UTF-8",$row['REG_PRIM']))."',".$row['P_NAG_1'].",'".trim(iconv("cp866","UTF-8",$row['DATA_REG']))."','".trim(iconv("cp866","UTF-8",$row['NOMER_REG']))."','".trim(iconv("cp866","UTF-8",$row['NOMER_TY']))."','".trim(iconv("cp866","UTF-8",$row['GOD_TY']))."',".$row['G_M'].",'".trim(iconv("cp866","UTF-8",$row['INN']))."',".$row['KOD_SPRIP1'].",".$row['KOD_SPRIP2'].",".$row['KOD_SPRIP3'].",'".trim(iconv("cp866","UTF-8",$row['PL_NOMER2']))."','".trim(iconv("cp866","UTF-8",$row['PL_DATA2']))."',".$row['PL_SUMMA2'].",'".trim(iconv("cp866","UTF-8",$row['PL_NOMER3']))."','".trim(iconv("cp866","UTF-8",$row['PL_DATA3']))."',".$row['PL_SUMMA3'].",'".trim(iconv("cp866","UTF-8",$row['USER_PF']))."','".trim(iconv("cp866","UTF-8",$row['N_TIP']))."','".trim(iconv("cp866","UTF-8",$row['N_USEL']))."','".trim(iconv("cp866","UTF-8",$row['EDIN_TY']))."','".trim(iconv("cp866","UTF-8",$row['IST_EL']))."','".trim(iconv("cp866","UTF-8",$row['NAME_2']))."',"; 
    ...
    ...
    $sql="INSERT INTO table (p_nomer,p_data,v_nomer,v_data,pl_nomer,pl_data,pl_summa,soder,na_sogl,n_ray,kod_pred,name_1,tip_ty,kod_ty,reg_prim,p_nag_1,data_reg,nomer_reg,nomer_ty,god_ty,g_m,inn,kod_sprip1,kod_sprip2,kod_sprip3,pl_nomer2,pl_data2,pl_summa2,pl_nomer3,pl_data3,pl_summa3,user_pf,n_tip,n_usel,edin_ty,ist_el,name_2,) VALUES ('".trim(iconv("cp866","UTF-8",$row['P_NOMER']))."','".trim(iconv("cp866","UTF-8",$row['P_DATA']))."','".trim(iconv("cp866","UTF-8",$row['V_NOMER']))."','".trim(iconv("cp866","UTF-8",$row['V_DATA']))."','".trim(iconv("cp866","UTF-8",$row['PL_NOMER']))."','".trim(iconv("cp866","UTF-8",$row['PL_DATA']))."',".$row['PL_SUMMA'].",'".trim(iconv("cp866","UTF-8",$row['SODER']))."','".trim(iconv("cp866","UTF-8",$row['NA_SOGL']))."','".trim(iconv("cp866","UTF-8",$row['N_RAY']))."','".trim(iconv("cp866","UTF-8",$row['KOD_PRED']))."','".trim(iconv("cp866","UTF-8",$row['NAME_1']))."','".trim(iconv("cp866","UTF-8",$row['TIP_TY']))."','".trim(iconv("cp866","UTF-8",$row['KOD_TY']))."','".trim(iconv("cp866","UTF-8",$row['REG_PRIM']))."',".$row['P_NAG_1'].",'".trim(iconv("cp866","UTF-8",$row['DATA_REG']))."','".trim(iconv("cp866","UTF-8",$row['NOMER_REG']))."','".trim(iconv("cp866","UTF-8",$row['NOMER_TY']))."','".trim(iconv("cp866","UTF-8",$row['GOD_TY']))."',".$row['G_M'].",'".trim(iconv("cp866","UTF-8",$row['INN']))."',".$row['KOD_SPRIP1'].",".$row['KOD_SPRIP2'].",".$row['KOD_SPRIP3'].",'".trim(iconv("cp866","UTF-8",$row['PL_NOMER2']))."','".trim(iconv("cp866","UTF-8",$row['PL_DATA2']))."',".$row['PL_SUMMA2'].",'".trim(iconv("cp866","UTF-8",$row['PL_NOMER3']))."','".trim(iconv("cp866","UTF-8",$row['PL_DATA3']))."',".$row['PL_SUMMA3'].",'".trim(iconv("cp866","UTF-8",$row['USER_PF']))."','".trim(iconv("cp866","UTF-8",$row['N_TIP']))."','".trim(iconv("cp866","UTF-8",$row['N_USEL']))."','".trim(iconv("cp866","UTF-8",$row['EDIN_TY']))."','".trim(iconv("cp866","UTF-8",$row['IST_EL']))."','".trim(iconv("cp866","UTF-8",$row['NAME_2']))."',)"; //запрос

    это часть кода для импорта данных из dbf

    Запостил: crs, 03 Марта 2011

    Комментарии (4) RSS

    Добавить комментарий