title: Wordpress wpdb undefined variable
body: <p>I'm writing a plugin and trying to request some data from a custom table in my database using:</p>
  
  <pre><code>$current_text = $wpdb-&gt;get_results("SELECT text FROM addtext ORDER BY id DESC LIMIT 1");
  </code></pre>
  
  <p>but just get the error Undefined variable: wpdb</p>
  
  <p>Any idea why this isn't working? I've followed the docs and scoured Google, with no luck. Still pretty new to WP plugins so probably something obvious.</p>
  
  <p>Thanks!</p>