How to use $wpdb in plugin
I’m trying to use $wpdb from a selfmade plugin. (Because obviously, I want to make my own queries and get the results from db)
The problem is: I just can’t use $wpdb for some reason.
Even something simple like
global $wpdb; $result = $wpdb->get_results("select * from wp_posts");
will make my .php file crash and stop doing anything…
What am I missing or doing wrong?
- The topic ‘How to use $wpdb in plugin’ is closed to new replies.