| 1 | <?php |
| 2 | |
| 3 | function usuRolAgrega(\PDO $bd, string $usuId, array $rolIds) |
| 4 | { |
| 5 | $usuRolAgrega = $bd->prepare( |
| 6 | "INSERT INTO USU_ROL (USU_ID, ROL_ID) values (:USU_ID, :ROL_ID)" |
| 7 | ); |
| 8 | foreach ($rolIds as $rolId) { |
| 9 | $usuRolAgrega->execute([ |
| 10 | ":USU_ID" => $usuId, |
| 11 | ":ROL_ID" => $rolId, |
| 12 | ]); |
| 13 | } |
| 14 | } |
| 15 |