Created
October 20, 2015 08:39
-
-
Save hmic/fe242793ebaa85cc91fe to your computer and use it in GitHub Desktop.
cakephp3, raw query to update 2 tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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