Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Filters in Values

phpMyEdit General     Filters in Values
Post new topic   Reply to topic    
 
aslan     Joined: 22 May 2004   Posts: 5  
Post Posted: 2004-05-22 18:37
Back to top  Reply with quote     

Did a quick search and didn't see anything that pointed me in the right direction. I have a table that houses labels for data. Example:
ID Name Group
1 Test 1
2 Lava 2
3 Hot 1

I want to only show those in group one in the pulldown menu for active so I tried putting a filter attribute in there. Not sure if there s anyway to do this or if I have to scrap using myEdit for these projects.

Thanks
A
Code:
$opts['fdd']['active'] = array(
  'name'     => 'Active/Passive',
  'select'   => 'D',
  'maxlen'   => 4,
  'default'  => '3',
  'required' => true,
  'sort'     => true,
  'values' => array(
      'table'       => 'tbl_labels',
      'column'      => 'label_id',
      'description' => 'label_name',
     'filter'       => 'where label_group = 2')
);


 
aslan     Joined: 22 May 2004   Posts: 5  
Post Posted: 2004-05-22 21:46
Back to top  Reply with quote     

Doesn't work either.

I'm wondering if you can use filters to affect the values for a select statement or not.

 
aslan     Joined: 22 May 2004   Posts: 5  
Post Posted: 2004-05-23 14:57
Back to top  Reply with quote     

Thanks for the response.

Gave it a try and it still doesn't work though :|

 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2004-05-23 20:38
Back to top  Reply with quote     

try 'filters' not 'filter', that should work (without where)

 
aslan     Joined: 22 May 2004   Posts: 5  
Post Posted: 2004-05-24 03:12
Back to top  Reply with quote     

That sure fixed it, that is Awesome you are going to save me a TON of time. Thanks!

 
debi     Joined: 05 Aug 2005   Posts: 1  
Post Posted: 2005-08-05 06:47
Back to top  Reply with quote     

Hi there,

This is just what I'm looking for except I'd like to replace the value "2" to with $value, and I can't get it to work. The value to pass on when you click on 'add', so the filter has no value... Is there a way around?

'values' => array(
'table' => 'tbl_labels',
'column' => 'label_id',
'description' => 'label_name',
'filter' => 'label_group = "2" ')


Thanks,

Debi

ps (added since original post) - this is probably a really bad fix but it kinda works: I've set the value as a cookie, with a meta tag refresh. It's a bit clunky but it works.

 
Aaron27377     Joined: 25 Jun 2021   Posts: 1  
Post Posted: 2021-06-25 07:34
Back to top  Reply with quote     

You have to do some practice with this code and see what you get in the return value. The essay writer explores few things that you can take into account and do your development work.

 
Post new topic   Reply to topic    

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