Understanding problem with repeating groups

Kant

Member
Hello,
I would like to use a repeating group. In this group will be a selection about databasejoin.
The parts of the related data should be published in the respective repeat group.
I can do that in a simple group, but not in a repeating group. I get the following error message

Unknown column 'adressen' in 'field list'

Is there an adjustment option:

There are personal data that are assigned to a group.
In the group there are different areas with fields of activity.
It should now be possible to combine fields of activity with personal data in the different areas
through a repeating group
.

regards,
Oliver

Maybe this is just the structure explanation:
 
Last edited:
Had a filter in the element, but the deletion did not help. Maybe I'll make a structural error as well.
 
Oh I think I have to ask the question differently.
How is it possible to display other elements of the list after a selection in a list (databasejoin) in the same group?
If this is possible then can be jion lists as well ?
And this is also possible in repetitive groups?

regards
Oliver
 
Hello,
I think I have come a step further. What I missed was the plugin autofil.
I have used the example from the tutorial and it works fine.
Where i still have any Problem, to using this feature in repeating groups.
Is there still a trick for it?
regards,
Oliver
 
Sorry, I thought I'd replied to suggest the autofill plugin.

I did have it working at one point in repeat groups, but haven't tested it for a little while. I'll take another look at that as soon as I can.

-- hugh
 
I need the'watched' FK element inside the repeat.
I am not sure if the autofill is applicable for this case.
I select a name from a list and need the corresponding email from another list.
Attached is the context

http://prntscr.com/hlyonn
Oliver
 
OK, in which case no, I don't think that'll work. The autofill plugin is relatively simple minded, and can only fetch data from the table the FK element points to.

You could probably use a calc, like ...

Code:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('email')->from('kommunikation')->where('id_addressen = ' . $db->quote('{yourtable___addressen_id_raw}');
$db->setQuery($query);
$return $db->loadResult();

Assuming I have the setup correct, that this is on some "other" form ("yourtable") where you have a join (addressen_id) to the addressen table.

-- hugh
 
First of all thank you for your help.
Unfortunately, I still get a syntax error (unexpected ';', expecting ',' or ')'). PHP is not my world, but must be closed ('adressen_id = '
I tried a lot, but I can not get on with it

Code:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('email_anschrift')->from('kommunikation')->where('adressen_id = ' . $db->quote('{yourtable___adressen_id_raw}');
$db->setQuery($query);
$return $db->loadResult();

regards,
Oliver
 
Last edited:
I missed a close paren on the third line...

Code:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('email_anschrift')->from('kommunikation')->where('adressen_id = ' . $db->quote('{yourtable___adressen_id_raw}'));
$db->setQuery($query);
$return $db->loadResult();
 
Meh, that's the trouble with writing PHP off the top of my head in the forums ... no syntax checking editor to catch my mistakes ... should be 'return' not '$return' ...

Code:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('email_anschrift')->from('kommunikation')->where('adressen_id = ' . $db->quote('{yourtable___adressen_id_raw}'));
$db->setQuery($query);
return $db->loadResult();

If you are going to be writing more than a few lines of PHP, it's worth installing an intelligent code editor that will tell you about syntax errors. NetBeans is a good free one, but there are lots to choose from. Having an editor tell you about syntax errors can save you many, many hours of frustration (and waiting for me to respond on the forums).

-- hugh
 
Thank you for your help. I will set up this editor.
I will no longer see a formatting error.
I still have the problem of accessing the Joomla database. My data is on a second database, which is located on the same server.
I tried to connect as follows.
Code:
$db = mysqli_connect("dbxxxxxxxx.db.1and1.com", "dboxxxxxx", "xxxxx", "dbxxxxxxxx");
$query = $db->getQuery(true);
$query->select('email_anschrift')->from('kommunikation')->where('adressen_id = ' . $db->quote('{yourtable___adressen_id_raw}'));
$db->setQuery($query);
return $db->loadResult();
Unfortunately, I did not succeed.

Since the second database is already set up, my question is whether there is an elegant way to address them.
That means without entering the access data?

regards
Oliver
 
Yes. Set it up as a second Connection in Fabrik's connections settings, then instead of JFactory:getDbo(), do...

$db = FabrikWorker::getDbo(false, 2);

... or whatever the ID of the new connection is (it'll probably be 2 if it's the first time you've added one).

Hugh


Sent from my HTC6545LVW using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top