Ajax URL from class and function

Ajax URL from class and function

hawkt1hawkt1 Posts: 1Questions: 1Answers: 0

Good evening,

Using the example on the website I have been able to get a data table working as expected.

What i'd like to do is call the server.php from within a class called Adam and a Function called Adam2. Is this possible?

index.php

$(document).ready(function() { $('#contact-detail').dataTable({ "scrollX": true, "pagingType": "numbers", "processing": true, "serverSide": true, "ajax": "server.php" } ); } );

server.php
// DB table to use
$table = 'users';

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

// 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' => 'userid', 'dt' => 0 ),
array( 'db' => 'name', 'dt' => 1 ),
array( 'db' => 'email', 'dt' => 2 ),
array( 'db' => 'uacid', 'dt' => 3,),
array( 'db' => 'sqn','dt' => 4,)

);

// SQL server connection information
$sql_details = array(
'user' => '',
'pass' => '',
'db' => '',
'host' => 'localhost'
);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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.php' );
include('ssp.php');

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

Answers

  • allanallan Posts: 63,262Questions: 1Answers: 10,424 Site admin

    If your Adam2 method being invoked on the Ajax call? If so, how?

    Allan

This discussion has been closed.