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
, 5 months 0 Answers 49 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
, , 5 months 0 Answers 74 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
, , 5 months 0 Answers 76 views

Question
I'm having troubles with the mysqli driver used by wordpress, where it is converting each and every integer value to a string within $wpdb->get_results("SELECT..."). I know that it is possible so use the the option MYSQLI_OPT_INT_AND_FLOAT_NATIVE with the mysqli ...
0
, 5 months 0 Answers 55 views