building-complex-db-queries

How to build complex database queries in ChronoForms.

Overview

The issue is determining where to place custom code for database operations.
Use a Custom Code action within your form where you need the data, and consider employing standard Joomla database methods for simplicity.

Answered
we webcrea 07 May, 2015
Hello,

In this example, where the code must be put ?

http://www.chronoengine.com/faqs/70-cfv5/5231-building-complex-db-queries-using-the-gcore-framework.html

thanks
chris
Gr GreyHead 07 May, 2015
Answer
Hi Chris,

In a Custom Code action somewhere that you want the data.

Bob

PS Personally if you are working in Joomla! I'd find it a lot simpler to use the Joomla! methods e.g.
. .  .
$db = JFactory::getDBO();
$query = "
    SELECT *
        FROM `#__content` AS c
        JOIN `#__users` AS u ON u.`id` = c.`created_by`
        WHERE c.`state` = 1
        ORDER BY c.`id`
        LIMIT 5 ;
";
$db->setQuery($query);
$data = $db->loadAssocList();
. . .
This topic is locked and no more replies can be posted.