Using MySQL stored procedures in laravel

Time:2021-9-16

Create a stored procedure (two parameters, the first parameter is activityid and the second parameter is IDS)
CREATE PROCEDURE update_wall_records(IN activityid INTEGER ,ids text)
BEGIN
UPDATE wall_records SET wall_activity_id = activityid
WHERE FIND_ IN_ SET(id,ids); # Equals where id in (‘1,2,3 ‘)
END;

Code call
DB::update(‘call update_wall_records(1,”1,2,3″) ‘);

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Supervisor

Supervisor [note] Supervisor – H view supervisor command help Supervisorctl – H view supervisorctl command help Supervisorctl help view the action command of supervisorctl Supervisorctl help any action to view the use of this action 1. Introduction Supervisor is a process control system. Generally speaking, it can monitor your process. If the process exits abnormally, […]