Subselect() will create a new column with some value from other (or current) table. You can use any columns from current tables as parameters. Subselect will be called for each row
<?php
$xcrud = Xcrud::get_instance();
$xcrud->table('customers');
$xcrud->columns('customerName,city,creditLimit,Paid,Profit'); // specify only some columns
$xcrud->subselect('Paid','SELECT SUM(amount) FROM payments WHERE customerNumber = {customerNumber}'); // other table
$xcrud->subselect('Profit','{Paid}-{creditLimit}'); // current table
$xcrud->sum('creditLimit,Paid,Profit'); // sum row(), receives data from full table (ignores pagination)
$xcrud->change_type('Profit','price','0',array('prefix'=>'$')); // number format
echo $xcrud->render();
?>
Customers
Customers
#
Customername
City
Creditlimit
Paid
Profit
Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/xcrud/xcrud.php on line 5443
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/xcrud/xcrud.php on line 11643