Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82115

Problem with Server Side Processing (PHP / MySQL)

$
0
0
Hello everyone,

I started to use server side processing (for PHP/MySQL) but I have a problem.
Before I displayed my Datatables like this :

<table class="table table-striped" id="liste">

............

<?php
$sql="SELECT * FROM songs";
$req= mysql_query($sql) or die('SQL Error!<br />'.$sql.'<br />'.mysql_error());
while($data=mysql_fetch_assoc($req)){
?>
<tr>
<!-- Display song -->
<td width="100px"><strong><?php echo html_entity_decode($data["song"]); ?></strong></td>
<td><?php echo nl2br(html_entity_decode($data['transcript'])); ?></td>
</tr>
<?php
}
?>


Now I use server side processing, but all data appear without style and without html_entity_decode function.

I would like to display
- into column 1 : bold text and use html_entity_decode.
- into column 2: use nl2br and html_entity_decode.

Do I have to edit this file? http://www.datatables.net/development/server-side/php_mysql

Here is what I have done :

<script>
$(document).ready(function() {
$('#liste').dataTable( {
"sDom": "<'row'<'span6'l><'span6'>r>t<'row'<'span6'i>>p",
"bLengthChange": false,
"iDisplayLength": 10,
"bSort": true,
"bSortClasses": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "pages/toto.php",
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 1 ] },
]
} );
} );
</script>


Thank you

Viewing all articles
Browse latest Browse all 82115

Trending Articles