TOPIC:

Content Builder fill select with database data in edit view 2 months 6 days ago #245220

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10063
  • Karma: 167
  • Thanks: 800
Hi,

please add a return $listdata in the end (this is important for breezingforms to store the values). You also need to add a leading "0;" to the list row (0 = not preselected, 1 = preselected):
<?php
$db = JFactory::getDBO();
$db->setQuery("SELECT EDV, Kurzform FROM #__osvvereine");
$contents = $db->loadObjectList();
$listdata = "Bitte Verein wählen;0\n"; 

for ($i = 0; $i < count($contents); $i++) {
                $listdata .= "0;{$contents[$i]->Kurzform};{$contents[$i]->EDV}\n";
}
$value = $listdata; // that's the important part for contentbuilder
return $listdata; // this is for BF, you need both
?>

Regards,
Markus

Please Log in or Create an account to join the conversation.

Last edit: Post by TheMuffinMan.

Content Builder fill select with database data in edit view 2 months 4 days ago #245406

  • Topic Author
  • relsig
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
HelloBy adding a leading 0 to $listdata .= "0;{$contents[$i]->Kurzform};{$contents[$i]->EDV}\n";The select element is not filled any more. I search in this forum and found other threads with the same code, but there also there is no leading 0.I'm I looking in the wrong direction?

Here is the select without the 0 in listdata


After saving there is the following data

Please see the last column. What is strange, is that there is a leading 0, there is the EDV number, but the Kurzform (should be Niedergesterln) is not shown.

Regards

Roger
Attachments:

Please Log in or Create an account to join the conversation.

Content Builder fill select with database data in edit view 2 months 4 days ago #245426

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10063
  • Karma: 167
  • Thanks: 800
Hm,

I forgot to add that leading zero for the first entry:
<?php
$db = JFactory::getDBO();
$db->setQuery("SELECT EDV, Kurzform FROM #__osvvereine");
$contents = $db->loadObjectList();
$listdata = "0;Bitte Verein wählen;0\n"; 

for ($i = 0; $i < count($contents); $i++) {
                $listdata .= "0;{$contents[$i]->Kurzform};{$contents[$i]->EDV}\n";
}
$value = $listdata; // that's the important part for contentbuilder
return $listdata; // this is for BF, you need both
?>

I mean this line above:

$listdata = "0;Bitte Verein wählen;0\n";

Maybe the missing "0;" from my code before caused this issue already.

Regards,
Markus

Please Log in or Create an account to join the conversation.

Content Builder fill select with database data in edit view 2 months 1 day ago #245576

  • Topic Author
  • relsig
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
Hi

I'm sorry, but there is still the same problem. Here the
<?php
$db = JFactory::getDBO();
$db->setQuery("SELECT EDV, Kurzform FROM #__osvvereine");
$contents = $db->loadObjectList();
$listdata = "0;Bitte Verein wählen;0\n"; 

for ($i = 0; $i < count($contents); $i++) {
                $listdata .= "0;{$contents[$i]->Kurzform};{$contents[$i]->EDV}\n";
}
$value = $listdata; // that's the important part for contentbuilder
return $listdata; // this is for BF, you need both
?>

Then I also opened the view and selected the Verein element. There is the separater "," defined, don't I have to change this to semicolon? In the script there is a semicolon as separator. But nevertheless the select element stays empty

Please Log in or Create an account to join the conversation.

Content Builder fill select with database data in edit view 2 months 1 day ago #245594

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10063
  • Karma: 167
  • Thanks: 800
Hi,

the code looks fine now and things like these are usually working.
For now the only thing I can imagine is that the #__osvvereine table doesn't or the EDV and Kurzform column don't exist (or the table is empty).

Please correct the spelling of these columns and tablename and keep in mind that these might be case sensitive.

If that all doesn't work, I can have a look at your form in your administration if you like.

Regards,
Markus

Please Log in or Create an account to join the conversation.

Content Builder fill select with database data in edit view 2 months 14 hours ago #245669

  • Topic Author
  • relsig
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 23
  • Thanks: 0
Hi,

When I remote the 0 before "Bitte wählen" and from the list, then the select is filled with the data. Therefore I think the the table and the columns contain data.

I will kindly accept your offer to look at it. I will send to you the connection data via email.

Regards

Roger

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.103 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!