title: Trying to retrieve data from wp DB
body: <p>I am trying to retrieve data from wp database here with my plugin code below. I have manually added records in the db but my plugin doesn't want to retrieve my data. I don't know where am I going wrong here. </p>
  
  <pre><code>&lt;?php
      /**
       * Plugin Name: Member Details         
       */
  
      function custom_view() {
       global $wpdb;          
  
       echo '&lt;table&gt;
        &lt;tr&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Email&lt;/th&gt;
          &lt;th&gt;Bank&lt;/th&gt;
          &lt;th&gt;Account Number&lt;/th&gt;
          &lt;th&gt;Deposited Amount&lt;/th&gt;
          &lt;th&gt;Deposit Date&lt;/th&gt;
          &lt;th&gt;Period [Days]&lt;/th&gt;            
        &lt;/tr&gt;';
       $results = $wpdb-&gt;get_results("select * from users"); 
  
       foreach( $results as $user_data) {                  
        // $roi = $user_data-&gt;amount * $user_data-&gt;period;  
        // $amount_growth = $roi - $user_data-&gt;amount;
  
         echo "&lt;tr&gt;
          &lt;td&gt;$user_data-&gt;user_nicename&lt;/td&gt;
          &lt;td&gt;$user_data-&gt;user_email&lt;/td&gt;
          &lt;td&gt;$user_data-&gt;bank&lt;/td&gt;
          &lt;td&gt;$user_data-&gt;account_num&lt;/td&gt;
          &lt;td&gt;$user_data-&gt;amount&lt;/td&gt;
          &lt;td&gt;$user_data-&gt;deposit_date&lt;/td&gt;
          &lt;td&gt;$user_data-&gt;period&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
          &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;";
       }
       echo '&lt;/table&gt;';         
      }
      add_shortcode('views', 'custom_view');
      ?&gt;
  </code></pre>
  
  <p>Can somebody help me here? Thanks</p>