Welcome Guest, Not a member yet? Register   Sign In
Cannot execute query update with multiple rows
#1

(This post was last modified: 05-03-2021, 10:14 AM by sfarzoso.)

I'm trying to update multiple rows using this code:

PHP Code:
$directoryId $this->request->getPostGet('directory_id');
        $where $this->request->getPostGet('media_ids');
        var_dump($where);
        var_dump($directoryId);
        $result $this->post->whereIn('id'$where)->update('parent'$directoryId); 

essentially $where contains this:

PHP Code:
array(2) {
  [0]=>
  string(4"1115"
  [1]=>
  string(4"1116"


and $directoryId is: 1132

I get:

PHP Code:
Return value must be of type array, string returned 
Reply
#2

"oh baby please give a little respect to ..." framework

RTFM

PHP Code:
$userModel
    
->whereIn('id', [1,2,3])
    ->set(['active' => 1])
    ->update(); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB