admin管理员组文章数量:1313347
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
add_shortcode('displ_tb', function(){
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;
} );
?>
本文标签: phpHow to display data from custom table in wordpress phpmyadmin
版权声明:本文标题:php - How to display data from custom table in wordpress phpmyadmin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741946650a2406456.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论