$wpdb->prepare UPDATE process not work in functions.php

Question

global $wpdb;
$meta_value = "image.jpg";
$post_id = 2223;

$wpdb->query($wpdb->prepare("UPDATE kl_posts SET post_content_filtered='$meta_value' WHERE kl_posts.ID=$post_id"));

this process never works in functions.php, what is the problem you think?

(this code works except the functions file.)

0
Melih511 2 months 2023-04-04T15:00:44-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse