Forums

Result of one connection showed in another

peters901 03 Jan, 2009
Hi,

I've made a connection with the following settings:

Name: test
Tablename:test
WHERE SQL: Where team = 'team1'
HEADER: <?php $totalresult = 0; ?>
BODY: <?php $totalresult = $totalresult + $row->amount; ?>
FOOTER: <?php echo $totalresult ;?>

What i want to do is to show the result, which is generated in the connection above, in the body of another connection? The Where statement has to be variabele later on but that's the next step for me. Is this possible?

Regards,

Jaap
Max_admin 03 Jan, 2009
Hi Jaap,

you can define that PHP variable as a global one and then call it back in the new connection or even add it to a session, depending on your needs!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
peters901 04 Jan, 2009
Hi Max,

Thanks for the reply, but do you perhaps have an example for me. It's all new for me.

Regards,

Jaap
Max_admin 04 Jan, 2009
Hi Jaap,

in the first connection and before any thing add this code in the head :

global $totalresult ;


in the 2nd connection do the same then use the same variable and it will hold the same data!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ranjeev 18 Jan, 2009
And, how do you store the data to a session?
Max_admin 19 Jan, 2009
$session =& JFactory::getSession();
$session->get('chrono__submissions_limit', 'default value', md5('chrono')); // retrieve session values
$session->set("chrono__submissions_limit", 'value', md5('chrono'));//set values


check the Joompla API site for more hints about the functions!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.