## How to display data from custom table in wordpress phpmyadmin

Question

Thanks in advance could anyone here help me, I would like to display the value from the phpmyadmin database in wordpress, The value was stored from the dropdown form and I want display that value in the page, I have used the following code and it working fine, just want to display the sum of pledges from the columns.

Following is the code and I want to display the sum of the pledges value stored in the phpmyadmin, it’s the dropdown value so please help me

<?php

global $wpdb;$table_name = $wpdb->prefix_pl . 'wp_vxcf_leads_detail'; // this will get the data from your table$dispdb_data = $wpdb->get_results( "SELECT * from$table_name" );
foreach ($dispdb_data as$dispdb_data){
$pledge =$dispdb_data->value;
$lead_id =$dispdb_data->lead_id;
}
$output = '<div class="wrap"> <h2>Pledges.</h2> <table> <tr> <th>Total Pledge</th> <th>Live Count</th> </tr> <tr> <td>'.$pledge .'</td>
<td>'. $lead_id .'</td> </tr> </table> </div>'; return$output;
} );

?>


0
8 months 2020-12-02T09:10:58-05:00 0 Answers 8 views 0