Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, April 19, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Multiple select from look-up tables doesn't work

phpMyEdit Configuration     Multiple select from look-up tables doesn't work
Post new topic   Reply to topic   Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next  
 
lemmi     Joined: 23 Jun 2004   Posts: 9  
Post Posted: 2004-06-29 19:20
Back to top  Reply with quote     

I try to implement a multiple select from a look-up table, but with no success. Is't a configuration problem or a bug (latest CVS version)??
Here the code:

Code:
$opts['fdd']['Comp_Category'] = array(
  'name'     => 'Cat.',
  'select'   => 'M',
  'maxlen'   => '50',
  'options'  => 'LVACP',
  'sort'     => true
);
$opts['fdd']['Comp_Category']['values']['table'] = 'tblcompany_section';
$opts['fdd']['Comp_Category']['values']['column'] = 'Cat_ID';
$opts['fdd']['Comp_Category']['values']['description'] = 'Name';


I always get a standard select box on an the Add/Change screen but a multiple select for filtering.
What is wrong?

Thanks for help!!!

 
lemmi     Joined: 23 Jun 2004   Posts: 9  
Post Posted: 2004-06-30 09:43
Back to top  Reply with quote     

Problem resolved!!

I have just added following code to function recreate_displayed() as proposed by hbernard:

Code:
//<hbernard - Line 2650 - add this lines to make 'M'ultiple work with ['values']['table']
            if ($this->fdd[$key]['select'] == 'M' &&   isset($this->fdd[$key]['values']['table'])) {
            $this->connect(); //connection to mysql, required for set_values_from....
            $this->fdd[$key]['values2'] = (array)$this->fdd[$key]['values2']
            + (array)$this->set_values_from_table($key);
            unset($this->fdd[$key]['values']); //useless values
            }
//>hbernard


That's all. It works as expected.

 
fgalian     Joined: 08 Jul 2009   Posts: 2  
Post Posted: 2009-07-08 08:50
Back to top  Reply with quote     

Hello, it seems that line 2650 reffers to an older source code. Could you please let me know where should I insert this code and if it still works with phpMyEdit/phpMyEdit.class.php,v 1.204 2007-09-16 12:57:07 ?? thanks in advance,

Franco

lemmi wrote:
Problem resolved!!

I have just added following code to function recreate_displayed() as proposed by hbernard:

Code:
//<hbernard - Line 2650 - add this lines to make 'M'ultiple work with ['values']['table']
            if ($this->fdd[$key]['select'] == 'M' &&   isset($this->fdd[$key]['values']['table'])) {
            $this->connect(); //connection to mysql, required for set_values_from....
            $this->fdd[$key]['values2'] = (array)$this->fdd[$key]['values2']
            + (array)$this->set_values_from_table($key);
            unset($this->fdd[$key]['values']); //useless values
            }
//>hbernard


That's all. It works as expected.


 
JammerPro     Joined: 07 Dec 2006   Posts: 33  
Post Posted: 2009-10-02 22:31
Back to top  Reply with quote     

fgalian wrote:
Hello, it seems that line 2650 reffers to an older source code. Could you please let me know where should I insert this code and if it still works with phpMyEdit/phpMyEdit.class.php,v 1.204 2007-09-16 12:57:07 ?? thanks in advance,

Franco

lemmi wrote:
Problem resolved!!

I have just added following code to function recreate_displayed() as proposed by hbernard:

Code:
//<hbernard - Line 2650 - add this lines to make 'M'ultiple work with ['values']['table']
            if ($this->fdd[$key]['select'] == 'M' &&   isset($this->fdd[$key]['values']['table'])) {
            $this->connect(); //connection to mysql, required for set_values_from....
            $this->fdd[$key]['values2'] = (array)$this->fdd[$key]['values2']
            + (array)$this->set_values_from_table($key);
            unset($this->fdd[$key]['values']); //useless values
            }
//>hbernard


That's all. It works as expected.


It works in 5.7.1 perfectly!

Insert the above code at Line 2980. Here's where:

Code:

if (is_array(@$this->fdd[$key]['values']) && ! isset($this->fdd[$key]['values']['table'])) {
            foreach ($this->fdd[$key]['values'] as $val) {
               $this->fdd[$key]['values2'][$val] = $val;
            }
            unset($this->fdd[$key]['values']);
         }

// [b]THIS IS LINE 2980 in Version 5.7.1 - Put the above code here!!!!![/b] Like this:

//<hbernard - Line 2650 - add this lines to make 'M'ultiple work with ['values']['table']
            if ($this->fdd[$key]['select'] == 'M' &&   isset($this->fdd[$key]['values']['table'])) {
            $this->connect(); //connection to mysql, required for set_values_from....
            $this->fdd[$key]['values2'] = (array)$this->fdd[$key]['values2']
            + (array)$this->set_values_from_table($key);
            unset($this->fdd[$key]['values']); //useless values
            }
//>hbernard

         isset($this->fdd[$key]['help']) && $this->guidance = true;
         $this->fdd[$field_num] = $this->fdd[$key];
         $field_num++;


 
sbuelow     Joined: 10 Jul 2009   Posts: 6  
Post Posted: 2011-01-10 11:31
Back to top  Reply with quote     

Hello there
Just had the same issue and applied the patch as suggested by hbernard on 5.7.1.
There's still a flaw tough.
Look like data is saved correctly, but when I edit the record, previously selected values don't get highlighted again.
The same doesn't happen with 5.6 release.

Anybody knows where to look for ?

Thanks

 
ddgiants     Joined: 15 Dec 2011   Posts: 1  
Post Posted: 2011-12-15 23:18
Back to top  Reply with quote     

I know this is old but just for any Googlers like me.
For 5.7.1 add above aforementioned code after line 2979.

However, to get it to choose previous selected items in update mode, you need to change this line at line 1539
foreach($selected as $val) $selecte2[]=(string)$val;
to this
foreach($selected as $val) $selected2[]=(string)$val;
Notice the missing d. All works great now, Thanks forum.

DD

sbuelow wrote:
Hello there
Just had the same issue and applied the patch as suggested by hbernard on 5.7.1.
There's still a flaw tough.
Look like data is saved correctly, but when I edit the record, previously selected values don't get highlighted again.
The same doesn't happen with 5.6 release.

Anybody knows where to look for ?

Thanks


 
Jacqueline     Joined: 16 Jan 2015   Posts: 1  
Post Posted: 2015-01-16 08:57
Back to top  Reply with quote     

Any way I can make it so that the user can select how many rows to display in the list?


___________
hiba

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2015-01-16 16:06
Back to top  Reply with quote     

http://hockinson.us/txt/num_recs.txt

 
jacobhue     Joined: 24 Feb 2022   Posts: 46  
Post Posted: 2022-05-27 13:02
Back to top  Reply with quote     

Your writing is really informative, especially because it's so meaningful and updated. Thanks for sharing this wonderful post! tcswebmail upsers prepaidgiftbalance

 
danverseak2     Joined: 07 Sep 2022   Posts: 62  
Post Posted: 2022-09-07 10:19
Back to top  Reply with quote     

They can expertly guide you through the entire process.
Granite Bay Fence Company

 
robinjack     Joined: 01 Mar 2021   Posts: 7259  
Post Posted: 2022-09-16 14:02
Back to top  Reply with quote     

baby strollers with high traction rollers should be much safer to use compared to those with plastic wheels- gudanglagu123

 
robinjack     Joined: 01 Mar 2021   Posts: 7259  
Post Posted: 2022-09-18 16:04
Back to top  Reply with quote     

I agree with most of your points, but a few need to be discussed further, I will hold a small talk with my partners and maybe I will look for you some suggestion soon. Amarose

 
topboosterseo     Joined: 24 Jul 2022   Posts: 4504  
Post Posted: 2022-09-25 11:31
Back to top  Reply with quote     

There are a couple of fascinating points with time on this page but I don&#8217;t know if these center to heart. There&#8217;s some validity but Let me take hold opinion until I look into it further. Great post , thanks and then we want a lot more! Combined with FeedBurner too Diaetoxil

 
robinjack     Joined: 01 Mar 2021   Posts: 7259  
Post Posted: 2022-09-27 16:07
Back to top  Reply with quote     

Youre so cool! I dont suppose Ive read anything in this way just before. So nice to get somebody with a few original thoughts on this subject. realy appreciation for beginning this up. this web site is something that is needed on the net, a person with some originality. helpful problem for bringing a new challenge towards web! Protetox

 
topboosterseo     Joined: 24 Jul 2022   Posts: 4504  
Post Posted: 2022-09-28 06:14
Back to top  Reply with quote     

You made some decent points there. I looked on the net for your problem and located most people goes together with along with your internet site. Heater Pro X

 
Post new topic   Reply to topic   Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next  

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy