database should show on front end in wordpress

Question

function display_branch_form()
{
wp_enqueue_style(‘display_branch’,’https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css’);
wp_enqueue_script(‘display_branch’,’https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js’);
wp_enqueue_script(‘display_branch’,’https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js’);
wp_enqueue_script(‘display_branch’,’https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js’);
wp_enqueue_script(‘display_branch’,plugin_dir_url(FILE).’/asset/display-branches.js’);
global $wpdb;
$table_name=$wpdb->prefix.’dbp_tb_branch’;
$content=”;
$content .=”;
$content .=”;
$content .= ”;
$content .=”;
$content .=”;
$content .=”;
$content .=’ID’;
$content .=’Branch Name’;

    $content .='</tr>';
$content .='</thead>';

$content .=’$DBP_results=$wpdb->get_results(“SELECT * FROM $table_name”);’;

$content .=’ foreach($DBP_results as $DBP_row){
$id=$DBP_row->id;
$branch=$DBP_row->branch;

    <tbody>
  <tr>
    <td><?php echo $id; ?></td>
    <td><?php echo $branch; ?></td>
 
    </tr>
</tbody>

}’;
$content .=”;

$content .=”;
$content .=”;
return $content;

}
add_action(‘wp_enqueue_scripts’,’display_branch_form’);
add_shortcode(“Display-Branches”,”display_branch_form”);

Database is not showing on front end in wordpress

0
, , Arshpreet Venveru 1 year 2020-07-25T02:10:29-05:00 0 Answers 56 views 0

Leave an answer

Browse
Browse