Sanjeev Sanjeev - 4 months ago 29
SQL Question

How to Display mysql table data in a wordpress page?

My aim is to develop a standard website using wordpress. I need to display data from a table in mysql database on my wordpress page.I have created a table in the same database that wordpress was installed.(DBname-digitigers,table_name:BookDetails: 13 columns).
Please help me.

Answer
   <?php
    global $wpdb;
      $results = $wpdb->get_results( "SELECT * FROM table_name order by id DESC"  );
foreach($results as $res) { 

        //echo $res->col1;

     }
    ?>