Skip to content

Commit

Permalink
* Group By added * Read Me file have changed
Browse files Browse the repository at this point in the history
  • Loading branch information
emran committed Sep 20, 2014
1 parent 21abb63 commit a81920b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -15,6 +15,9 @@ So due to allow complex query, I have changed the [SSP class](https://github.com

- I have added option to ADD JOIN Query and make necessary changes.
- I have changed Column ARRAY format to handle get data from multiple table. Add TWO new index for complex query handle.
- Add Extra Where condition through SSP Class.
- You can Group by the result via sending Query through simple function of SSP Class.


### New formatted COLUMN Array #####

Expand Down
1 change: 0 additions & 1 deletion example/simple.html → example/index.html
Expand Up @@ -43,7 +43,6 @@ <h1>Customaized SSP DataTables example <span>Server-side processing</span></h1>
<li>I have added option to ADD JOIN Query and make necessary changes.</li>
<li>I have changed Column ARRAY format to handle get data from multiple table. And add TWO new index(‘field’, ‘as’) for complex query handle.</li>
</ul>
<p> The New Things add by me :</p>

<ul>
<li>Read data from Multiple table via JOIN.</li>
Expand Down
2 changes: 1 addition & 1 deletion example/scripts/server_processing.php
Expand Up @@ -46,7 +46,7 @@
// SQL server connection information
$sql_details = array(
'user' => 'root',
'pass' => 'root123',
'pass' => 'root',
'db' => 'test',
'host' => 'localhost'
);
Expand Down
8 changes: 4 additions & 4 deletions example/scripts/ssp.customized.class.php
Expand Up @@ -17,10 +17,10 @@


// REMOVE THIS BLOCK - used for DataTables test environment only!
$file = $_SERVER['DOCUMENT_ROOT'].'/datatables/mysql.php';
if ( is_file( $file ) ) {
include( $file );
}
// $file = $_SERVER['DOCUMENT_ROOT'].'/datatables/mysql.php';
// if ( is_file( $file ) ) {
// include( $file );
// }


class SSP {
Expand Down
6 changes: 4 additions & 2 deletions ssp.php
Expand Up @@ -218,7 +218,7 @@ static function filter ( $request, $columns, &$bindings, $isJoin = false )
* @return array Server-side processing response array
*
*/
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $joinQuery = NULL, $extraWhere = '')
static function simple ( $request, $sql_details, $table, $primaryKey, $columns, $joinQuery = NULL, $extraWhere = '', $groupBy = '')
{
$bindings = array();
$db = SSP::sql_connect( $sql_details );
Expand All @@ -242,14 +242,16 @@ static function simple ( $request, $sql_details, $table, $primaryKey, $columns,
$joinQuery
$where
$extraWhere
$groupBy
$order
$limit";
}else{
$query = "SELECT SQL_CALC_FOUND_ROWS `".implode("`, `", SSP::pluck($columns, 'db'))."`
FROM `$table`
$where
$extraWhere
$order
$groupBy
$order
$limit";
}

Expand Down

0 comments on commit a81920b

Please sign in to comment.