jeudi 1 août 2019

Update database with arrays after checking arrays

I am trying to update a database with array. before updating i am checking database with an array because some table has no primary key.

here is my code

 foreach ($compareData as $keu => $valo) { 
          $da=$processData[$keu];
          foreach ($da as $key => $value) {
       $r= DB::table($a)->where($valo)->update([$key => $value]);

         }

      }

after that i am getting below's error

"SQLSTATE[22007]: Invalid datetime format: 7 ERROR: invalid input syntax for type timestamp: "" (SQL: update "kengensettei" set "kengenchar01" = user where ("kengenchar01" = user and "kengenchar02" = and "kengenchar03" = qc3001 and "kengenchar04" = =見積データ新規登録=見積リスト既存データ呼出・変更=受注リスト and "kengenchar05" = and "kengenchar06" = and "kengenchar07" = and "kengendate01" = and "kengendate02" = and "kengendate03" = and "kengenint01" = and "kengenint02" = and "kengenint03" = and "kengenint04" = and "kengenint05" = and "kengenint06" = and "kengenint07" = and "kengenint08" = and "kengenint09" = and "kengenint10" = )) ◀"

i have tried with different syntax but getting the same error.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire