I have added the following query but it doesn't work, after I added set x line. Please help me fix this query
BEGIN
DECLARE x INT;
SET x = SELECT donation_id FROM wp_give_donationmeta ORDER BY wp_give_donationmeta.meta_id DESC LIMIT 1;
UPDATE wp_posts SET post_status= 'Sponsored' WHERE ID= x;
END