Skip to content

Instantly share code, notes, and snippets.

@hmic
Created October 20, 2015 08:39
Show Gist options
  • Save hmic/fe242793ebaa85cc91fe to your computer and use it in GitHub Desktop.
Save hmic/fe242793ebaa85cc91fe to your computer and use it in GitHub Desktop.
cakephp3, raw query to update 2 tables
<?php
$this
->connection()
->newQuery()
->update('registrations, employees')
->set(['registrations.employee_id = employees.id'])
->where([
'registrations.employee_id IS NULL',
'registrations.employee_number = employees.employee_number',
])
->execute()
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment