Element to query

enrb

Member
Good morning,

I have a form with databasejoin and cascadingdropdown fields where users can choose different options.

Can I create an item that gives me the value of a query based on the choices made when filling out the form?
 
I tried to make my query, but it doesn't return any results, also how do I insert into the query the elements to be considered for the final result of the query?

The query I made is this (following the instructions of the calc element)

Code:
$db = FabrikWorker::getDbo();
$query = $db->getQuery(true);

$query->clear()
  ->select('mytable.code')
  ->from($db->quoteName('mytable'))
  ->innerjoin($db->quoteName('mytable002') . ' ON ' . $db->quoteName('mytable.id') . ' = ' . $db->quoteName('mytable002.code2'))
  ->where(array(
    $db->quoteName('mytable.id') . ' = ' . $db->quote('{mytable002.code2}')
  ));

$db->setQuery($query);
$count = $db->loadResult();
return $count;
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top