更新参数中的错误codeigniter habdesvalortot = habdesvalortot+参数

发布于 01-20 06:36 字数 881 浏览 3 评论 0原文

            $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 set habdesvalortot = habdesvalortot * $ parametro

filename:c:/wamp64/wwww/novatek/novatek/system/system/database/database/db_driver.php

line:69111

            $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');
            
            
        }

Error UPDATE habdesempleados SET HabDesValorTot = HabDesValorTot * $parametro

Filename: C:/wamp64/www/novatek/system/database/DB_driver.php

Line Number: 691

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

帥小哥2025-01-27 06:36:16

strong 变量与串联操作员('。')

您应该串联'habdesvalortot*'字符串与 $ parametro

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

You should concatenate 'HabDesValorTot * ' string with $parametro variable with the concatenation operator ('.')

Try this

$this->db->set('HabDesValorTot', '`HabDesValorTot` * ' . $parametro, FALSE);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文