Its possible to get ajax a specyfic rows from mysql?

Its possible to get ajax a specyfic rows from mysql?

AidisAidis Posts: 1Questions: 1Answers: 0

Its possible to get ajax a specyfic rows from mysql?

I want only get a rows where a value 'two' its numer 1.

I try edit ssp.class.php but not working good.

Ajax code:
```
<?php
$sql_details = array(
'user' => 'user',
'pass' => 'pass',
'db' => 'db',
'host' => 'localhost'
);

$columns = array(
    array( 'db' => 'one', 'dt' => 0 ),
    array( 'db' => 'two', 'dt' => 1 ), // get only rows from this variable
    array( 'db' => 'three', 'dt' => 2 ),
    array( 'db' => 'four', 'dt' => 3 ),
    array( 'db' => 'five', 'dt' => 4 ),     
);   

require('ssp.class.php');

echo json_encode(
    SSP::simple( $_GET, $sql_details, 'table', 'one', $columns )
);
<?php > ``` ?>

Answers

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin

    The SSP class is really just a demo - it is possible to do what you are looking for with SSP::complex which accepts an array for conditions - e.g.:

    SSP::simple( $_GET, $sql_details, 'table', 'one', $columns, null, [
      'two' => 1
    ] )
    

    However, I would strongly encourage you to take a look at our Editor PHP libraries. They are open source under the MIT license and are fully documented, have features such as joins and support server-side processing.

    There is a blog post about using them here.

    Allan

Sign In or Register to comment.