I'm trying to access my database through one of my pages and wpdb keeps on returning null. Here's my code:
<?php global $wpdb; $table_name = $wpdb->prefix . "mcpd_currency"; $results = $wpdb->get_var("SELECT code FROM ".$table_name." WHERE currency='Australian Dollars'", ARRAY_A); var_dump($results); ?>
This works when I use this on my plugin files but not on a page. Does anyone know why this is?