Question
global $wpdb; $custom_post_type = 'post'; // define your custom post type slug here // A sql query to return all post titles $results = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type = %s and post_status = 'publish' OR post_status ='draft' ", ...
0
, 1 month 0 Answers 21 views

Question
I have a shortcode in my WordPress page with which I access the WordPress database with wpdb. It works perfectly with wpdb-> get_results () and wpdb-> query (), but I am not able to execute an insert with a blob data. With ...
0
, , 1 month 0 Answers 30 views

Question
I'm not crazy familiar with WPDB or SQL in general but I have a custom table for my project and I'm trying to assign some metadata to it. What I'd "like" to happen is if a row exists, update it ...
0
, , 1 month 0 Answers 32 views