Can Not obtain data from mySql

Can Not obtain data from mySql

OverthereOverthere Posts: 3Questions: 2Answers: 0
edited November 2015 in DataTables 1.9

Hello folks,
I am new to datatables and am having a heck of a time getting started. I can not even get the examples to work right.
I am using Windows 7 Professional, WebMatrix 3, PHP v 5,4 and MySQL v5.
I created a database "testexamples" and was able to load the example data just fine.
So I gutted a page and tried to rework it to use my database. It goes nowhere. I am not using the Editor.
And wish to use server-side etc. I am also rather confused about the ssp.class.php. I understand the coding but and I to execute this in MySQ?? I see it rederence and rather confused about it.
My datatables folder is located on drive c. I have a problem with the examples working too. Just for kicks I deleted some records, execute an example and the records still appeared but they shouldn't cause I had deleted them, I just want to get going here and quickly too. Any help is appreciated..
Below is my coding:

 <?php 
    require_once ("myserver_processing.php"); 
include("ssp.class.php") 
 ?> 
 <html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">

<!-- DataTables CSS -->
<link rel="stylesheet" type="text/css" href="media/css/jquery.dataTables.css">
  
<!-- jQuery -->
<script type="text/javascript" charset="utf8" src="media/js/jquery.js"></script>
  
<!-- DataTables -->
<script type="text/javascript" charset="utf8" src="media/js/jquery.dataTables.js"></script>


<script type="text/javascript" language="javascript" class="init">


$.extend( true, $.fn.dataTable.defaults, {
    "searching": false,
    "ordering": false
} );


$(document).ready(function() {
    $('customermaster').DataTable();
} );
</script>



</head>
<body>
    <table>
                <thead>
                    <tr>
                        <th>firstname</th>
                        <th>middlename</th>
                        <th>lastname</th>
                        <th>email</th>
                    </tr>
                </thead>

                <tfoot>
                    <tr>
                        <th>First</th>
                        <th>Middle</th>
                        <th>Last</th>
                        <th>Email</th>
                    </tr>
                </tfoot>
            </table>

</body>
</html>

Answers

  • glendersonglenderson Posts: 231Questions: 11Answers: 29
    edited November 2015

    Starting with the very basic, unless I'm missing something, you need to reference your table correctly via an id.

    $('customermaster').DataTable(); should be $('#customermaster').DataTable();

    Give the same id "customermaster" to your table tag
    <table id='customermaster'>

  • OverthereOverthere Posts: 3Questions: 2Answers: 0

    Thank you so much. I had wondered about that fact which is why I asked about the # - I found no reference in the documentation concerning it -

  • marthaj6289marthaj6289 Posts: 3Questions: 2Answers: 0

    Once again thank you! I had tried various combo but not together. Your comment did it!
    Such a simple thing! sigh.. :) I am rolling now!

This discussion has been closed.