For running J!5.1 you must https://fabrikar.com/forums/index.php?wiki/update-from-github/ or include the new file manually https://fabrikar.com/forums/index.php?threads/joomla-5-1-and-fabrik-cannot-find-files-error.54473/post-285151 See also Announcements
Please see our announcement here.
blank screenNo idea what you are doing.
Your code is working fine (after substituting with my table and column names).
What do you get by adding
echo $query; exit;
$expedient = '{gpimpagats___gp_imp_cuotaimpagat_raw}';
// get "deute anual" sum
$mydb = JFactory::getDbo();
$query = $mydb->getQuery(true);
$query->select('SUM('.$mydb->quoteName('gp_imp_totaldeute').')');
$query->from($mydb->quoteName('gpimpagats'));
$query->where($mydb->quoteName('gp_imp_cuotaimpagat').' = '.$mydb->quote($expedient));
echo $query; exit;
$mydb->setQuery($query);
$total_deute_anual = $mydb->loadResult();
// return result (in all rows)
return $total_deute_anual;
hello!!With thisCode:$expedient = '{gpimpagats___gp_imp_cuotaimpagat_raw}'; // get "deute anual" sum $mydb = JFactory::getDbo(); $query = $mydb->getQuery(true); $query->select('SUM('.$mydb->quoteName('gp_imp_totaldeute').')'); $query->from($mydb->quoteName('gpimpagats')); $query->where($mydb->quoteName('gp_imp_cuotaimpagat').' = '.$mydb->quote($expedient)); echo $query; exit; $mydb->setQuery($query); $total_deute_anual = $mydb->loadResult(); // return result (in all rows) return $total_deute_anual;
I think some information is missing or wrong. Please check and tell:
1. The table name is "gpimpagats"? No prefix? (Like e.g. "xyz_gpimpagats" or so?)
2. "gp_imp_cuotaimpagat" is the Fabrik name of the element with label "Expedient", yes?
3. What element type is "gp_imp_cuotaimpagat"?
4. "gp_imp_totaldeute" is the Fabrik name of a numeric element, yes?
5. What element type is "gp_imp_totaldeute"?
hello!!P.S.:
12. What is the Fabrik element name = DB column name for the label "Any impagat" (= year)?
If that's known, it's also easy to display the totals only in rows with the most recent year, not in rows of previous years.
hello!!What do you get if you put
SELECT SUM(`gp_imp_totalpendent`) FROM `gpimpagats` WHERE `gp_imp_expedient` = '489'
directly in phpMyAdmin?
Hello...Ok, if it doesn't work directly on your DB it obviously can't work in Fabrik.
Seems you are on the wrong database.