1

I want to run a update query but it is not working with multiple conditions.

$where = ['parent_id'  => (int)$shipmentId,
                  'order_item_id' => (int)$itemId,
                 ];

        $connection->update(
        $tableName,
        array("status" => 'requested'),
        $where
        );

How can I do that?

2 Answers 2

1

Try:

$where = [
    'parent_id = ?'  => (int)$shipmentId,
    'order_item_id = ?' => (int)$itemId,
];
0

Please replace this

$where = ['parent_id'  => (int)$shipmentId,
          'order_item_id' => (int)$itemId,
         ];

with:

$where = ['parent_id'  => (int)$shipmentId,
          'order_item_id' => (int)$itemId
         ];
2
  • I have tried both Commented Jul 20, 2018 at 13:00
  • 2
    These options are identical... Commented Jan 11, 2021 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.