How to run SQL query from WordPress ‘WP Crontrol’ plugin

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com
QUẢNG CÁO: Đổi thẻ cào thành tiền mặt min rút 10k tại đây

I have a SQL query which does exactly what I want if I run it directly in the database:

And have added this code to my functions.php file in my child theme:

But I’m trying to get it to run using a plugin called ‘WP Crontrol’.

It has an option for adding a new Cron Event and so I’m using the hook cron_expire_nonactive_memberships and have been running it manually but nothing happens.

I’m running as a localhost if that makes any difference.

I’m not sure if I have a problem with my php code that’s attempting to run my SQL – how can I debug what’s going on?

Edit:

Hmm, I can see a lot of the following in the error logs but I’m unsure how to resolve:

PHP Notice: Undefined property: wpdb::$wp_users in C:xampphtdocsmyprojectwp-includeswp-db.php on line 648

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com