当前位置: 首页>>代码示例>>PHP>>正文


PHP bd::insert方法代码示例

本文整理汇总了PHP中bd::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP bd::insert方法的具体用法?PHP bd::insert怎么用?PHP bd::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bd的用法示例。


在下文中一共展示了bd::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: LlamadaInsert

 function LlamadaInsert()
 {
     $obj = new bd();
     $array = array(99, "pruebacontraseña", 'jorge', 'jorge@jorge.com');
     return $obj->insert('usuario', $array);
     echo 'hola';
 }
开发者ID:GemmaAgra,项目名称:ptuit,代码行数:7,代码来源:pruebainsert.php

示例2: regerar_rank

function regerar_rank()
{
    $bd = new bd();
    //        $var  = "ESPVIDA;FECTOT;MORT1;MORT5;RAZDEP;SOBRE40;SOBRE60;T_ENV;E_ANOSESTUDO;T_ANALF11A14;T_ANALF15A17;T_ANALF15M;T_ANALF18A24;T_ANALF18M;T_ANALF25A29;T_ANALF25M;T_ATRASO_0_BASICO;T_ATRASO_0_FUND;T_ATRASO_0_MED;T_ATRASO_1_BASICO;T_ATRASO_1_FUND;T_ATRASO_1_MED;T_ATRASO_2_BASICO;T_ATRASO_2_FUND;T_ATRASO_2_MED;T_FBBAS;T_FBFUND;T_FBMED;T_FBPRE;T_FBSUPER;T_FLBAS;T_FLFUND;T_FLMED;T_FLPRE;T_FLSUPER;T_FREQ0A3;T_FREQ11A14;T_FREQ15A17;T_FREQ18A24;T_FREQ25A29;T_FREQ4A5;T_FREQ4A6;T_FREQ5A6;T_FREQ6;T_FREQ6A14;T_FREQ6A17;T_FREQFUND1517;T_FREQFUND1824;T_FREQFUND45;T_FREQMED1824;T_FREQMED614;T_FREQSUPER1517;T_FUND11A13;T_FUND12A14;T_FUND15A17;T_FUND16A18;T_FUND18A24;T_FUND18M;T_FUND25M;T_MED18A20;T_MED18A24;T_MED18M;T_MED19A21;T_MED25M;T_SUPER25M;CORTE1;CORTE2;CORTE3;CORTE4;CORTE9;GINI;PIND;PINDCRI;PMPOB;PMPOBCRI;PPOB;PPOBCRI;PREN10RICOS;PREN20;PREN20RICOS;PREN40;PREN60;PREN80;PRENTRAB;R1040;R2040;RDPC;RDPC1;RDPC10;RDPC2;RDPC3;RDPC4;RDPC5;RDPCT;RIND;RMPOB;RPOB;THEIL;CPR;EMP;P_AGRO;P_COM;P_CONSTR;P_EXTR;P_FORMAL;P_FUND;P_MED;P_SERV;P_SIUP;P_SUPER;P_TRANSF;REN0;REN1;REN2;REN3;REN5;RENOCUP;T_ATIV;T_ATIV1014;T_ATIV1517;T_ATIV1824;T_ATIV18M;T_ATIV2529;T_DES;T_DES1014;T_DES1517;T_DES1824;T_DES18M;T_DES2529;THEILtrab;TRABCC;TRABPUB;TRABSC;T_AGUA;T_BANAGUA;T_DENS;T_LIXO;T_LUZ;AGUA_ESGOTO;PAREDE;T_CRIFUNDIN_TODOS;T_FORA4A5;T_FORA6A14;T_FUNDIN_TODOS;T_FUNDIN_TODOS_MMEIO;T_FUNDIN18MINF;T_M10A14CF;T_M15A17CF;T_MULCHEFEFIF014;T_NESTUDA_NTRAB_MMEIO;T_OCUPDESLOC_1;T_RMAXIDOSO;T_SLUZ;HOMEM0A4;HOMEM10A14;HOMEM15A19;HOMEM20A24;HOMEM25A29;HOMEM30A34;HOMEM35A39;HOMEM40A44;HOMEM45A49;HOMEM50A54;HOMEM55A59;HOMEM5A9;HOMEM60A64;HOMEM65A69;HOMEM70A74;HOMEM75A79;HOMEMTOT;HOMENS80;MULH0A4;MULH10A14;MULH15A19;MULH20A24;MULH25A29;MULH30A34;MULH35A39;MULH40A44;MULH45A49;MULH50A54;MULH55A59;MULH5A9;MULH60A64;MULH65A69;MULH70A74;MULH75A79;MULHER80;MULHERTOT;PEA;PEA1014;PEA1517;PEA18M;peso1;PESO1114;PESO1113;PESO1214;peso13;PESO15;peso1517;PESO1524;PESO1618;PESO18;Peso1820;PESO1824;Peso1921;PESO25;peso4;peso5;peso6;PESO610;Peso617;PESO65;PESOM1014;PESOM1517;PESOM15M;PESOM25M;pesoRUR;pesotot;pesourb;PIA;PIA1014;PIA1517;PIA18M;POP;POPT;I_ESCOLARIDADE;I_FREQ_PROP;IDHM;IDHM_E;IDHM_L;IDHM_R";
    //
    //
    //        $ex = explode(';',$var);
    //
    //        $result = array();
    //
    //        foreach($ex as $v){
    //            $v = trim($v);
    //            $sql = "select id from variavel where sigla ILIKE '$v'";
    //            $arr = $bd->ExecutarSQL($sql);
    //            echo $arr[0]['id'].",$v<br />";
    //        }
    //        $result = array();
    //        foreach($ex as $v){
    //            $v = trim($v);
    //            $sql = "select id from municipio where substring(geocodmun::text from 0 for 7) = '$v'";
    //            $arr = $bd->ExecutarSQL($sql);
    //            if(count($arr) > 1){
    //                die("ERROOOOOOOOOO: $v");
    //            }
    //            if($c > 10) die();
    //            echo $arr[0]['id']."<br />";
    //            $result[] = $arr[0]["id"];
    //            $c++;
    //        }
    //        $lines = file("config/rank_save.csv");
    //        $insert = array();
    //        $sql = "INSERT INTO rank(fk_municipio,posicao_idh,posicao_e_idh,posicao_idhe,posicao_e_idhe,posicao_idhr,posicao_e_idhr,posicao_idhl,posicao_e_idhl) VALUES ";
    //        foreach($lines as $linha){
    //            $insert[] = "(".implode(',',explode(';', $linha)).")";
    //        }
    //        $sql .= implode(',', $insert);
    //        $bd->insert($sql);
    //        die($sql);
    die;
    return;
    $bd = new bd();
    $ALL = array();
    $bd->insert("TRUNCATE TABLE rank");
    $SQL1 = "SELECT fk_municipio,valor,fk_variavel FROM valor_variavel_mun\n                                  WHERE fk_variavel IN (196) and fk_ano_referencia = 3 ORDER BY valor_variavel_mun.valor desc";
    $SQLR = "SELECT fk_municipio,valor,fk_variavel FROM valor_variavel_mun\n                                  WHERE fk_variavel IN (197) and fk_ano_referencia = 3 ORDER BY valor_variavel_mun.valor desc";
    $SQLL = "SELECT fk_municipio,valor,fk_variavel FROM valor_variavel_mun\n                                  WHERE fk_variavel IN (198) and fk_ano_referencia = 3 ORDER BY valor_variavel_mun.valor desc";
    $SQLE = "SELECT fk_municipio,valor,fk_variavel FROM valor_variavel_mun\n                                  WHERE fk_variavel IN (199) and fk_ano_referencia = 3 ORDER BY valor_variavel_mun.valor desc";
    $arr = $bd->ExecutarSQL($SQL1);
    $last = "";
    $posicao = 0;
    foreach ($arr as $key => $v) {
        $v["valor"] = cutNumber($v["valor"], 3, ',', '');
        if ($last != $v["valor"]) {
            $posicao++;
        }
        $last = $v["valor"];
        $ALL[$v["fk_municipio"]][$v["fk_variavel"]] = $posicao;
    }
    $arr = $bd->ExecutarSQL($SQLR);
    $last = "";
    $posicao = 0;
    foreach ($arr as $key => $v) {
        $v["valor"] = cutNumber($v["valor"], 3, ',', '');
        if ($last != $v["valor"]) {
            $posicao++;
        }
        $last = $v["valor"];
        $ALL[$v["fk_municipio"]][$v["fk_variavel"]] = $posicao;
    }
    $arr = $bd->ExecutarSQL($SQLL);
    $last = "";
    $posicao = 0;
    foreach ($arr as $key => $v) {
        $v["valor"] = cutNumber($v["valor"], 3, ',', '');
        if ($last != $v["valor"]) {
            $posicao++;
        }
        $last = $v["valor"];
        $ALL[$v["fk_municipio"]][$v["fk_variavel"]] = $posicao;
    }
    $arr = $bd->ExecutarSQL($SQLE);
    $last = "";
    $posicao = 0;
    foreach ($arr as $key => $v) {
        $v["valor"] = cutNumber($v["valor"], 3, ',', '');
        if ($last != $v["valor"]) {
            $posicao++;
        }
        $last = $v["valor"];
        $ALL[$v["fk_municipio"]][$v["fk_variavel"]] = $posicao;
    }
    for ($i = 1; $i <= 27; $i++) {
        $SQL = "SELECT fk_municipio,valor,fk_variavel FROM valor_variavel_mun\n                        INNER JOIN municipio as m ON (fk_municipio = m.id)\n                        WHERE fk_variavel IN (196) and fk_ano_referencia = 3 AND m.fk_estado = {$i} order by valor";
        $arr = $bd->ExecutarSQL($SQL);
        $last = "";
        $posicao = 0;
        foreach ($arr as $key => $v) {
            $v["valor"] = cutNumber($v["valor"], 3, ',', '');
            if ($last != $v["valor"]) {
                $posicao++;
//.........这里部分代码省略.........
开发者ID:eriveltonguedes,项目名称:atlas_ivs,代码行数:101,代码来源:controller.php


注:本文中的bd::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。