TOPIC:

Re: Liste déroulante / select depuis base de données 7 years 11 months ago #120161

  • av74
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Thank you for your answer but nothing is displayed in the listbox.
I try to display the field "name"ist of my Joomla users in the listbox "Nom" of my form.
For this I put your code into a piece form in the advanced tab: options form
is this the right way

best regards

Alain

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

Re: Liste déroulante / select depuis base de données 7 years 11 months ago #120164

  • chrisal's Avatar
  • chrisal
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 6983
  • Karma: 187
  • Thanks: 630
Hello again,


are you sure that your database prefix is jos_ ?

Please check this.


Here is the code again with some comments/instructions!:
//Do not change
$this->execPieceByName('ff_InitLib');

//First option of the select list
$test = "1;Please select;";

//The database Query Change jos_users to the prefix + database table name
$query='Select * from jos_users';

//Do not change
$result = ff_select($query);


//Do not change
foreach($result As $res){
//This will add the name of the user to the select list /As the value & text
$test .= "0;{$res->name};{$res->name}\n";
//Name will be shown and id is the label
//ICI "col2" et "id" SONT DEUX COLONES DE LA BASE DE DONNEES
}

//Change nom to the name of the select list
ff_setSelectList('nom', $test);



//Do not change
function ff_setSelectList($name, $value)
{
global $ff_processor;
for ($r = 0; $r < $ff_processor->rowcount; $r++)
{
$row =& $ff_processor->rows[$r];
if ($row->name==$name)
$row->data2 = $value;
unset($row);
} // for
} // ff_setSelectList



regards
Chris

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

Re: Liste déroulante / select depuis base de données 7 years 11 months ago #120180

  • av74
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
It works!
I misspelled the name of the listbox :)
Thank you very much for your help

best regards
Alain

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

Liste déroulante / select depuis base de données 7 years 11 months ago #120201

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1077
Nice!

let us know if you have further questions.

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.045 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!