dataTables and wordpress

dataTables and wordpress

negutnegut Posts: 1Questions: 1Answers: 0

i want to read a wordpress mySql table and display it in a wordpress specific page.(i call it page-2565)

So the code is :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >

<head>
<link rel="stylesheet" type="text/css" href="<?php echo bloginfo('template_directory') ?>/../genesis-child-1/css/dataTables.min.css"/>
/../genesis-child-1/jquery-ui-1.11.4.custom/jquery-ui.min.js>">
/../genesis-child-1/jquery-ui-1.11.4.custom/jquery.min.js" type="text/javascript">
/../genesis-child-1/js/dataTables.min.js" type="text/javascript">
</head>

<body>
<?php echo bloginfo('template_directory') ?> //get visual template directory - just for know path - will be removed

First name Last name Position Office Start date Salary
First name Last name Position Office Start date Salary
$(document).ready(function() { alert('dddddddd'); //test jquery ready event work $('#example').DataTable( { "processing": true, "serverSide": true, "ajax": "<?php echo bloginfo('template_directory') ?>/../../../DataTables-1.10.10/examples/server_side/scripts/server_processing.php" } ); } );

</body>
</html>

and server_processing.php

<?php

/*
* DataTables example server-side processing script.
*
* Please note that this script is intentionally extremely simply to show how
* server-side processing can be implemented, and probably shouldn't be used as
* the basis for a large complex system. It is suitable for simple use cases as
* for learning.
*
* See http://datatables.net/usage/server-side for full details on the server-
* side processing requirements of DataTables.
*
* @license MIT - http://datatables.net/license_mit
*/

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
echo "hhhhhhh";
// DB table to use
$table = 'wp_facileforms_subrecords';

// Table's primary key
$primaryKey = 'id';

// Array of database columns which should be read and sent back to DataTables.
// The db parameter represents the column name in the database, while the dt
// parameter represents the DataTables column identifier. In this case simple
// indexes
$columns = array(
array( 'db' => 'Denumire Amplasament', 'dt' => 0 ),
array( 'db' => 'Numar total de locuri', 'dt' => 1 ),
array( 'db' => 'Numar locuri active', 'dt' => 2 ),
array( 'db' => 'Numar locuri persoane cu dizabilitati','dt' => 3 ),
);

// SQL server connection information
$sql_details = array(
'user' => 'aspmbro',
'pass' => 'biroulit1',
'db' => 'aspmbro_1',
'host' => 'mysql2.romtelecom.net'
);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP
* server-side, there is no need to edit below this line.
*/

require( 'ssp.class.php' );

echo json_encode(
SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns )
);

Doesn,t work

My question is.
1. Row MySql data returned fron query in JSON format became automated a part of html after ajax call ?
i mean is their an intermediate file created?
2.what is wrong in ajax call?

This discussion has been closed.