Searching not working with custom SQL

Searching not working with custom SQL

JayWelshJayWelsh Posts: 4Questions: 2Answers: 0
edited January 2016 in Free community support

I have edited the ssp.class.php to use the following query when retrieving data:

$data = self::sql_exec($db, $bindings, "SELECT SQL_CALC_FOUND_ROWS `" . implode("`, `", self::pluck($columns, 'db')) . "`            
FROM `x_product`
WHERE NOT EXISTS (SELECT * FROM supplier_main_product_list WHERE supplier_main_product_list.x_product_code = x_product.x_product_code)
             $order
             $limit"
        );

This works perfectly in terms of populating the Datatable, but when I try to perform a search on the Datatable it doesn't do anything ("processing" indicator flashes on and off over the table, keeping all of the data and not performing any sort of search)

What could I do to make the search functionality still work?

Answers

  • JayWelshJayWelsh Posts: 4Questions: 2Answers: 0

    Fixed, used:

    SSP::complex($_GET, $sql_details, $table, $primaryKey, $columns, $whereResult, $whereAll = "NOT EXISTS (SELECT * FROM supplier_main_product_list WHERE supplier_main_product_list.x_product_code = x_product.x_product_code
                                 )")
    
This discussion has been closed.