Add Bootstrap Table With Sorting Searching and Paging into my PHP function

0 votes

I have an issue adding  bootstrap Table With Sorting, Searching and Paging, This is my Code :

<div class="data-content">
<span>REPORT SELECTION</span>
<div class="data-table" id="tableData">
<?php
$qry="select id, name, identity, created, payOption, amount, receivedBy from payment" ;
$result = mysqli_query($conn,$qry);

if ($result->num_rows > 0) {
    echo "<table id='dataTable'><tr><th>Payer</th><th>Passport/IC No</th><th>Date Paid</th><th>Payment Type</th><th>Payment Amount</th><th>Received by</th><th>Payment Receipt</th></tr>";

    while($row = $result->fetch_assoc()) {
        echo "<tr id=".$row["id"]."><td>".$row["name"]."</td><td>".$row["identity"]."</td><td>".$row["created"]."</td><td>".$row["payOption"]."</td><td>".$row["amount"]."</td><td>".$row["receivedBy"]."</td><td><a href='invoice.php' onclick='sessionFunction(".$row["id"].")'>View</a></td></tr>";
    }
    echo "</table>";
} else {
}
?>
</div>
</div>

The original output : Output

I have tried this:

<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">   
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" 

href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css"></style>
<script type="text/javascript" 

src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" 

src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

But didn't work. I have also tried the script function but didn't get the results. Can someone please help me with this issue?

Jun 27 in PHP by narikkadan
• 11,280 points
28 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
0 answers

Retrieve data from db and display it in table in php .. see this code whats wrong with it?

$db = mysql_connect("localhost", "root", ""); ...READ MORE

Jul 25 in PHP by Kithuzzz
• 3,480 points
7 views
0 votes
1 answer

Complete PHP form with proper validation and syntax

Hey @kartik, It's quite simple to have php ...READ MORE

answered Feb 19, 2020 in PHP by Niroj
• 82,740 points
577 views
0 votes
1 answer

How to Execute PHP function with onclick?

Hello @kartik, In javascript, make an ajax function, function ...READ MORE

answered Jun 16, 2020 in PHP by Niroj
• 82,740 points
17,290 views
0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,740 points
1,579 views
0 votes
1 answer

How can I use Sockets.io on the client side and communicate with a PHP based application on the server?

Hello @kartik, For 'long-lived connection' , you can ...READ MORE

answered Aug 24, 2020 in PHP by Niroj
• 82,740 points
1,561 views
0 votes
1 answer

How to call function of one php file from another php file and pass parameters to it?

Hello @kartik, Include the first file into the ...READ MORE

answered Aug 27, 2020 in PHP by Niroj
• 82,740 points
13,578 views
0 votes
0 answers

Show values from a MySQL database table inside a HTML table on a webpage

I am working on retrieving the values ...READ MORE

May 29 in PHP by Kichu
• 19,040 points
45 views
0 votes
0 answers
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
539 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
9,271 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP