[newbie question] datatable not working

[newbie question] datatable not working

scragsyscragsy Posts: 3Questions: 0Answers: 0
edited June 2012 in General
Hi, My first post on here and I'm a newbie to this.
I am developing a PHP website which is going to take values from a database and display it inside a datatable. The data I can get just fine, but the functionality of the Datatable isn't there (No filtering/pagination etc). I am also using twitter bootstrap for the layout.

Code:
[code]




@import "css/jquery.dataTables.css";

$(document).ready( function(){
$('#the_table').dataTable();
});


[/code]

Code in Body:
[code]


***SQL Connection and Select Statements***



Customer Order Number
Sales Order Number
Order Date
Order Status
Order Details



<?php
while ($row = mysql_fetch_array($dbrs))
{
?>




<?php echo $row['CustomerOrderNumber']; ?>
<?php echo $row['SalesOrderNumber']; ?>
<?php $timestamp = strtotime($row['OrderDate']); echo date('d/m/Y', $timestamp); ?>
<?php echo $row['OrderStatus']; ?>
View Order Details » <?php echo $row['SalesOrderNumber']; ?>

<?php
}
?>


[/code]

What am I doing wrong? Any help is really Appreciated :)

Replies

  • nickog3dnickog3d Posts: 4Questions: 0Answers: 0
    Have you tried with a hardcoded table, just to make sure there is no issue with your formatting coming out from the mysql results?
    Are the js files in the right location on your server?
    Do you get any errors in console?
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    All good suggestions. I'd also point out that the HTML is invalid (the input elements as children of the tr). DataTables expects valid HTML.

    Allan
This discussion has been closed.