第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

嘗試更新 2 個表中的數(shù)據(jù)

嘗試更新 2 個表中的數(shù)據(jù)

PHP
江戶川亂折騰 2022-06-17 15:45:59
這是代碼:  if ($param1 == 'do_update') {            $data['student_id']         = $this->input->post('student_id');            $data['title']              = html_escape($this->input->post('title'));            if ($this->input->post('description') != null) {                $data['description']        = html_escape($this->input->post('description'));            }            $data['amount']             = html_escape($this->input->post('amount'));            $data['amount_paid']        = html_escape($this->input->post('amount_paid'));            $data2['amount']            = html_escape($this->input->post('amount'));            /*$data['status']             = $this->input->post('status');*/            $data['creation_timestamp'] = strtotime($this->input->post('date'));            $this->db->where('invoice_id', $param2);            $this->db->update('invoice', $data);            $this->db->where('invoice_id', $param2);            $this->db->update('payment', $data2);2 表發(fā)票和付款...我可以使用特定 ID 更新“發(fā)票表”中的數(shù)據(jù),但同時,它正在更新“付款表”中的整個列而不是該特定 ID。我可以看出在最后 4 行中做錯了什么。$data 字段屬于 Invoice 表,$data2 字段屬于 Payment 表Invoice_id 在兩個表中都很常見..
查看完整描述

1 回答

?
人到中年有點(diǎn)甜

TA貢獻(xiàn)1895條經(jīng)驗(yàn) 獲得超7個贊

你實(shí)際上并沒有使用你的 where 條件。嘗試:

$this->db->where('invoice_id', $param2)->update('invoice', $data);
$this->db->where('invoice_id', $param2)->update('payment', $data2);


查看完整回答
反對 回復(fù) 2022-06-17
  • 1 回答
  • 0 關(guān)注
  • 104 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號