how i can display data using php pdo mysql datatable? i am very confuse

how i can display data using datatable ? i can't display data

this function show data
function viewData(){
'bProcessing': true,
'bServerSide': true,
url :"core/process.php",
type: "post",
success : function(data){

this query show data using pdo mysql

$stmt = $db->prepare("SELECT * FROM pelanggan");
  $no = 1;
  while($row = $stmt->fetch()){
    <td><?php echo $no++;?></td>
    <td><?php echo $row['id_pelanggan'];?></td>
    <td><?php echo $row['nm_pelanggan'];?></td>
    <td><?php echo $row['alamat'];?></td>
    <td><?php echo $row['telepon'];?></td>
    <td><?php echo $row['email'];?></td>
    <td width="160">
      <button class="btn btn-warning" data-toggle="modal" data-target="#edit-<?php echo $row['id_pelanggan']; ?>">Edit</button>
      <button type="button" class="btn btn-danger" onclick="deleteData(<?php echo $row['id_pelanggan']?>)"> Delete </button>

and this structure table

<div class="table-responsive">
          <table class="table table-striped table-bordered" id="contoh">

                <th>Kode Pelanggan</th>
                <th>Nama Pelanggan</th>
                <th>Nomor Telepon</th>
                <th>Email Pelanggan</th>
                <th width="50">Action</th>




how i can fix it?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!