How to reload datatable using php & mysql ?

How to reload datatable using php & mysql ?

hackernamhackernam Posts: 2Questions: 0Answers: 0

My code:

<?php $con = mysql_connect("localhost","root",""); if(!$con) { die("Error:".mysql_error()); } mysql_select_db("abc",$con); $result = mysql_query("select * from product"); ?>
<div>
<ul class="breadcrumb">
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">Tables</a>
</li>
</ul>
</div>

<div class="row">
<div class="box col-md-12">
<div class="box-inner">
<div class="box-header well" data-original-title="">
    <h2><i class="glyphicon glyphicon-user"></i> Datatable + Responsive</h2>

    <div class="box-icon">
        <a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a>
        <a href="#" class="btn btn-minimize btn-round btn-default"><i
                class="glyphicon glyphicon-chevron-up"></i></a>
        <a href="#" class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a>
    </div>
</div>
<div class="box-content">
<div class="alert alert-info">For help with such table please check <a href="http://datatables.net/" target="_blank">http://datatables.net/</a></div>
<table class="table table-striped table-bordered bootstrap-datatable datatable responsive" id="datatables">
<thead>
<tr>
    <th>Name</th>
    <th>Price</th>
</tr>
</thead>
<tbody>

<?php
while ($row = mysql_fetch_array($result))
{?>
<tr>
    <td><?=$row['name']?></td>
    <td><?=$row['price_sale']?></td>
</tr>
<?php
}
?>


                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div><!--/span-->

Replies

  • hackernamhackernam Posts: 2Questions: 0Answers: 0

    help me please

  • tangerinetangerine Posts: 3,342Questions: 35Answers: 394
    edited October 2014

    A. I don't understand what you mean by "reload" in this context.

    B. I don't see where you're initialising DataTables in your code.

This discussion has been closed.