该视频仅会员有权观看
立即开通课程「Node 框架 Express 实践」权限。
- Create a function named
delete_user_like_post in the lake service to cancel likes.
- The function removes a specific record from the
user like post table.
- It accepts two number-type parameters:
user_id and post_id.
- A SQL
delete statement is prepared with placeholders for the conditions, where user_id and post_id must match specific values.
- After preparing the query, it's executed on the database.
- The function returns the result of the execution, referred to as
data.