Having issues with sorting

Having issues with sorting

TunnleramTunnleram Posts: 5Questions: 1Answers: 0

I ran the debuger, but I didn't get any unique number to post :(

I have a very simple page I'm using to test this. The table has only two rows. Unfortunately the sorting buttons do nothing.

=============

<?php

session_start();

require_once './includes/connect.php';

<?php > ?>

<head>


<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">



<SCRIPT language="Javascript">
$(document).ready(function() {
$('#table_id').dataTable( {
"aaSorting": [[ 4, "desc" ]]
} );
} );
</SCRIPT>

</head>

<?php

echo "

"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //query article data $data = mysql_query("SELECT * FROM persons p"); while($info = mysql_fetch_array( $data )) { $person_status = $info['status']; $person_type = $info['type']; $person_class = $info['class']; $person_rank = $info['rank']; $person_first_name = $info['first_name']; $person_last_name = $info['last_name']; $person_home_phone = $info['home_phone']; $person_mobile_phone = $info['mobile_phone']; $person_work_phone = $info['work_phone']; $person_street = $info['street']; $person_city = $info['city']; $person_state = $info['state']; $person_zipcode = $info['zipcode']; $person_primary_email = $info['primary_email']; $person_secondary_email = $info['secondary_email']; $person_birthday = $info['birthday']; $person_join_date = $info['join_date']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
NameTypeRankClassCityBirthdayJoined
$person_first_name $person_last_name$person_type$person_rank$person_class$person_city$person_birthday$person_join_date

";

<?php > ?>

</body>
</html>

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Your code makes no reference to either the jQuery or DataTables js files.

  • TunnleramTunnleram Posts: 5Questions: 1Answers: 0

    Not sure what happened, but it was there. Something wrong with the paste.

    ================

    <?php

    session_start();

    require_once './includes/connect.php';

    <?php > ?>

    <head>


    <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">



    <SCRIPT language="Javascript">
    $(document).ready(function() {
    $('#table_id').dataTable( {
    "aaSorting": [[ 4, "desc" ]]
    } );
    } );
    </SCRIPT>

    </head>

    <?php

    echo "

    "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //query article data $data = mysql_query("SELECT * FROM persons p"); while($info = mysql_fetch_array( $data )) { $person_status = $info['status']; $person_type = $info['type']; $person_class = $info['class']; $person_rank = $info['rank']; $person_first_name = $info['first_name']; $person_last_name = $info['last_name']; $person_home_phone = $info['home_phone']; $person_mobile_phone = $info['mobile_phone']; $person_work_phone = $info['work_phone']; $person_street = $info['street']; $person_city = $info['city']; $person_state = $info['state']; $person_zipcode = $info['zipcode']; $person_primary_email = $info['primary_email']; $person_secondary_email = $info['secondary_email']; $person_birthday = $info['birthday']; $person_join_date = $info['join_date']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
    NameTypeRankClassCityBirthdayJoined
    $person_first_name $person_last_name$person_type$person_rank$person_class$person_city$person_birthday$person_join_date

    ";

    <?php > ?>

    </body>
    </html>

  • TunnleramTunnleram Posts: 5Questions: 1Answers: 0

    When I post it, it's removed, but I have references to

    //code.jquery.com/jquery-1.10.2.min.js
    //cdn.datatables.net/1.10.2/js/jquery.dataTables.js

  • TunnleramTunnleram Posts: 5Questions: 1Answers: 0

    I uploaded a live copy - http://thehonorsquad.com/datatables/

  • TunnleramTunnleram Posts: 5Questions: 1Answers: 0

    Anyone have any ideas?

This discussion has been closed.