0 votes
264 views
asked in Wordpress by
How do I include $wpdb in wordpress plugin?

1 Answer

0 votes
answered by
global $wpdb, $table_prefix;

if(!isset($wpdb))
{
    include_once(ABSPATH.'wp-config.php');
    include_once(ABSPATH.'wp-includes/wp-db.php');
}

Related questions

0 votes
0 answers 284 views
+1 vote
1 answer 367 views
0 votes
0 answers 1.5k views
+1 vote
1 answer 1.1k views
+1 vote
1 answer 320 views
...