title: Wordpress How to retrieve results from database using $wpdb
body: <p>I have a table of values and I would like a user to choose a row from the list with a drop-down menu in a WordPress page and have values from various columns populated in the same WordPress page. </p>
  
  <p>I am trying to learn how to use the $wpdb class in WordPress to do this, I am trying to understand first how to write something that will be displayed in the user's browser, but I think I might be missing some critical parts:</p>
  
  <p>What I have done is to create a table called 'wp_axleaa' in my WordPress database. I am trying to query this table and the only result I get printed is “Array”</p>
  
  <p>I wrote a plugin as follows:</p>
  
  <pre><code>&lt;?php
  /**
  * @package Trying to Connect
  * @version 1.6
  */
  /*
  Plugin Name: Trying to Connect
  Plugin URI:
  Description: Connecting to DB with $wpdb
  Author: Paul J
  Version: 1.0
  Author URI:
  */
  
  function tc_info() {
      global $display;
      global $wpdb;
      $display = $wpdb-&gt;get_results(
      '
      SELECT *
          FROM $wpdb-&gt;wp_axleaa
      ');
      print $display;
      }
  
  add_shortcode('showinfo','tc_info');
  ?&gt; 
  </code></pre>
  
  <p>Then I put the shortcode [showinfo] into my WordPress site, and when I view the page then it just shows “Array”. If I add a WHERE clause to the SQL statement, then I get an error message on the page.</p>
  
  <p>I am very new to WordPress and writing PHP and would really appreciate any help, I'm sorry if this is a long-winded question...</p>
  
  <p>Thanks very much, </p>