Hello Fabrik Community
Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.
Exciting times to be sure.
The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section
We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..
Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.
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.