Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Multiple select dropdown - Column type 'SET' mandatory?

phpMyEdit General     Multiple select dropdown - Column type 'SET' mandatory?
Odoslať novú tému   Odpovedať na tému    
 
hgw     Založený: 23.06.2008   Príspevky: 3  
Príspevok Zaslal: 2008-06-23 17:29
Návrat hore  Odpovedať s citátom     

Hello,
I've read some posts here and also succesfully managed to create a dropdown with values lookup from another table (holzarten). What I can't find out is to make this a multiple select dropdown. I'm only getting a simple select, and in the source there's no 'multiple' atrribute in the select tag.
Kód:

$opts['fdd']['t_holzarten'] = array(
  'name'     => 'T holzarten',
  'select'   => 'M',
  'maxlen'   => 26,
  'sort'     => true
);
$opts['fdd']['t_holzarten']['values']['table']    = 'holzarten';
$opts['fdd']['t_holzarten']['values']['column']   = 'h_id';
$opts['fdd']['t_holzarten']['values']['description']   = 't_holzart';


Maybe the database column for that multiple values has to be in MySQL type SET? But applying the set type I have to predefine the values which is confusing as the values should come from the 'holzarten' table. Probably I'm missing an important piece of MySQL and PhpMyEdit knowledge.

Thanks for a hint into the right direction!

 
hgw     Založený: 23.06.2008   Príspevky: 3  
Príspevok Zaslal: 2008-06-27 08:41
Návrat hore  Odpovedať s citátom     

No solution, or isn't it possible?

I'm getting 5 error messages as cited in my first post, no matter how many data is retrieved from the table.

Thanks!

 
hgw     Založený: 23.06.2008   Príspevky: 3  
Príspevok Zaslal: 2008-06-30 11:16
Návrat hore  Odpovedať s citátom     

Thanks,
I already did the phpMyEdit.Class.php correction. The mysql errors are fixed, they were due to another small problem.

Remains the multiple drop-down with looked up data .... I should have a multiple dropdown with lookup, the client is editing doors which are available in multiple wood surfaces, the wood surfaces should be editable in a different table and connected to the doors table via lookup.

So I can't put them as predefined values in an array in the doors table...

Thanks again for any ideas :-)

 
sba     Založený: 31.07.2008   Príspevky: 12  
Príspevok Zaslal: 2008-07-31 08:14
Návrat hore  Odpovedať s citátom     

i had the same problem and it seems that 'values' with multiple-select is not working:

my solution: create the values2 array manually:

Kód:

$res = mysql_query('SELECT * FROM t_holzarten');
foreach($res as $row){
   $woods[$row['h_id']] = $row['t_holzart'];
}
$opts['multiple'] = count($woods); //show all items



and then use simply:

Kód:

$opts['fdd']['t_holzarten'] = array(
  'name'     => 'T holzarten',
  'select'   => 'M',
  'maxlen'   => 26,
  'values2'  => $woods,
);


 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov