Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82029

Field::inst with subquery return null in mysql

$
0
0

Greetings,
I'm using a subquery in the Field::inst() of PHP editor class.
For example, the main table is Sales:

Field::inst('(SELECT SUM(payments.price) FROM `payments` WHERE payments.sale_id = sales.id)','net_price')

This query works fine in Sqlite, I also copied the query from (debug) and run it in phpmyadmin, and worked fine. It is returning (3000) for example.
But the returned value is null in the JSON. I tried to put getFormatter and var_dump the $data variable. It is also Null.
Btw sorting works fine for the real net_price value of the record behind the seen, although it still appears as null.
Am I missing something ? or there is kind of protection between the Mysql result and formatting the value in response ?


Viewing all articles
Browse latest Browse all 82029

Trending Articles