0

I am using cakephp 3.3 for my vod application and i want to insert data using following query:

$query=$notifications->query()->insert(['message' ,'status','user_id' ,'video_id' ,'notify_to' ,'notification_type'])
                    ->values([
                        'message'=>'Congratulations! your video '.$video_name.' has been approved to be uploaded on MM2View by admin.',
                        'status'=>$status,
                        'user_id'=>$user_id[0]['users_id'],
                        'video_id'=>$id,
                        'notify_to'=>1,
                        'notification_type'=>3
                    ])
                ->execute();

But i am getting

Cannot convert value to bool : InvalidArgumentException Error message. I have done some google related to this problem but did not find any correct solution.

Sahadev
  • 1,368
  • 4
  • 18
  • 39
  • Whenever receiving errors, please always post **the _complete_ error**, that is, **including the _full_ stacktrace** (ideally copied from the logs where it is available in a properly readable fashion), even if the problem might be obvious to people who are familiar with CakePHP! Also exception error pages do come with context information, ie passed arguments, etc, make sure to include these details too. Lastly, when the database is involved, also show your DB schema (that's where the problem stems from). – ndm Nov 12 '16 at 13:53

1 Answers1

0

Invalid argument exceptions are caused because of type mismatch in operations you written in the code.

Check your model class for the type you given and compare it with the code

Manzoor Samad
  • 889
  • 1
  • 9
  • 16