codeigniter 更新参数时出错代码点火器habdesvalortot = habdesvalortot +参数

vxf3dgd4  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(92)
$query2 = $this->db->get_where('habdesempleados',array('HabDesMes'=>$this->input->post('Mes') , 'EmplRut'=>$this->input->post('Rut'),'HabDesAno'=>$this->input->post('Ano'), 'HDTipo' =>'H' , 'Imponible' =>'True'  ));
    //  $query2 = $this->db->get();
        if($query2->num_rows() > 0){
            
            //$this->db->set('HabDesValorTot', '`HabDesValorTot`+ 1', FALSE);
            $parametro = 1;
$this->db->set('HabDesValorTot', '`HabDesValorTot` * $parametro', FALSE);
$this->db->update('habdesempleados');
            
            
        }

错误更新habdesempleados设置HabDesValorTot = HabDesValorTot * $参数
文件名:/wamp 64/www/novatek/系统/数据库/DB_驱动程序. php
行号:691

zed5wv10

zed5wv101#

您应该使用连接运算符('.')将**'HabDesValorTot*'字符串与$parametro**变量连接起来
试试这个

$this->db->set('HabDesValorTot', '`HabDesValorTot` * ' . $parametro, FALSE);

相关问题