Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 11. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Filters not working

phpMyEdit General     Filters not working
Odoslať novú tému   Odpovedať na tému    
 
Arpa     Založený: 17.09.2006   Príspevky: 3  
Príspevok Zaslal: 2006-09-17 01:20
Návrat hore  Odpovedať s citátom     

I haven't been able to make my filters work (in versions 5.5 and new 5.6)

my current def:

Kód:
$opts['fdd']['ttunnus'] = array(
  'name'     => 'Teki',
  'select'   => 'T',
  'maxlen'   => 3,
  'default'  => '0',
  'required' => true,
      'values' => array(
      'table' => 'pelaajat',
      'column' => 'tunnus',
      'filters' => 'joukkue = 2',
      'description' => 'nimi',
      'orderby' => 'etu'),
  'sort'     => true
);

the result is:

Column 'joukkue' in on clause is ambiguous
and query:

Kód:
SELECT PMEtable0.maaliid AS qf0,PMEjoin1.onimi AS qf1,PMEtable0.otteluid AS qf1_idx,PMEjoin2.nimi AS qf2,PMEtable0.ttunnus AS qf2_idx,PMEjoin3.nimi AS qf3,PMEtable0.stunnus AS qf3_idx,PMEtable0.minuutti AS qf4,PMEjoin5.kuvaus AS qf5,PMEtable0.ttid AS qf5_idx,PMEtable0.kuvaus AS qf6 FROM maalit AS PMEtable0 LEFT OUTER JOIN pmp.ottelut AS PMEjoin1 ON (PMEjoin1.otteluid = PMEtable0.otteluid AND kausi = 2006) LEFT OUTER JOIN pmp.pelaajat AS PMEjoin2 ON (PMEjoin2.tunnus = PMEtable0.ttunnus AND joukkue = 2) LEFT OUTER JOIN pmp.pelaajat AS PMEjoin3 ON (PMEjoin3.tunnus = PMEtable0.stunnus) LEFT OUTER JOIN pmp.tekotapa AS PMEjoin5 ON (PMEjoin5.ttid = PMEtable0.ttid) ORDER BY PMEtable0.maaliid


I can make the list page work is I use $jointable or PMEjoin3 in the filter. But then the edit/add page doesn't work.

btw the 5.5 version didn't give me any errors but any filters didn't work either so I think 5.6 "fixed" filters in joins? But there's still something to fix I quess?

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2006-09-18 13:10
Návrat hore  Odpovedať s citátom     

try 'filters' => '$join_table.joukkue = 2',
or 'filters' => 'PMEjoin2.joukkue = 2',

 
Arpa     Založený: 17.09.2006   Príspevky: 3  
Príspevok Zaslal: 2006-09-18 23:20
Návrat hore  Odpovedať s citátom     

michal Napísal:
try 'filters' => '$join_table.joukkue = 2',
or 'filters' => 'PMEjoin2.joukkue = 2',


List page works but add page gives

Kód:

MySQL error 1109
Unknown table '$join_table' in where clause


I got the impression the 'filter' line would not work on list page only edit/add pages? obviously I'm wrong or misunderstood something...

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2006-09-19 09:40
Návrat hore  Odpovedať s citátom     

yes, 'filters' is in add/change modes.

in other modes, there is 'join' option (with similar configuration).

 
Arpa     Založený: 17.09.2006   Príspevky: 3  
Príspevok Zaslal: 2006-09-19 14:45
Návrat hore  Odpovedať s citátom     

michal Napísal:
yes, 'filters' is in add/change modes.

in other modes, there is 'join' option (with similar configuration).


Thanks, unfortunately I just can't make it work in both list and add page at the same time.

If I make the filter work on add page (by adding pelaajat.joukkue=2 to $opts['fdd']['ttunnus']['values']['filters'] = 'pelaajat.joukkue = 2';) then it doesn't work on list page (unknown table pelaajat)

Combinations of $join_table etc. have all been unsuccessfull.

So what I can understand is that using ['join'] should make my list join only certain values, and ['values']['filters'] should display only a selection of rows in edit/add page right? They should not work on both pages at the same time?

here my current setup:

Kód:

$opts['fdd']['ttunnus'] = array(
  'name'     => 'Teki',
  'select'   => 'T',
  'maxlen'   => 3,
  'default'  => '0',
  'join'     => '$main_table.kausi = 2006',
  'required' => true,
  'sort'     => true
);
$opts['fdd']['ttunnus']['values']['table'] = 'pelaajat';
$opts['fdd']['ttunnus']['values']['column'] = 'tunnus';
$opts['fdd']['ttunnus']['values']['filters'] = 'pelaajat.joukkue = 2';
$opts['fdd']['ttunnus']['values']['orderby'] = 'suku';
$opts['fdd']['ttunnus']['values']['description']['columns'][0] = 'etu';
$opts['fdd']['ttunnus']['values']['description']['divs'][0]    = ', ';
$opts['fdd']['ttunnus']['values']['description']['columns'][1] = 'lempinimi';
$opts['fdd']['ttunnus']['values']['description']['divs'][1]    = ', ';
$opts['fdd']['ttunnus']['values']['description']['columns'][2] = 'suku';


and result is:

MySQL error 1109
Unknown table 'pelaajat' in on clause
MySQL error 1109
Unknown table 'pelaajat' in on clause
phpMyEdit error: invalid SQL query
SELECT PMEtable0.maaliid AS qf0,PMEjoin1.onimi AS qf1,PMEtable0.otteluid AS qf1_idx,CONCAT(PMEjoin2.etu,", ",PMEjoin2.lempinimi,", ",PMEjoin2.suku) AS qf2,PMEtable0.ttunnus AS qf2_idx,PMEjoin3.nimi AS qf3,PMEtable0.stunnus AS qf3_idx,PMEtable0.minuutti AS qf4,PMEjoin5.kuvaus AS qf5,PMEtable0.ttid AS qf5_idx,PMEtable0.kuvaus AS qf6 FROM maalit AS PMEtable0 LEFT OUTER JOIN pmp.ottelut AS PMEjoin1 ON (PMEjoin1.otteluid = PMEtable0.otteluid AND PMEjoin1.kausi = 2006) LEFT OUTER JOIN pmp.pelaajat AS PMEjoin2 ON (PMEjoin2.tunnus = PMEtable0.ttunnus AND pelaajat.joukkue = 2) LEFT OUTER JOIN pmp.pelaajat AS PMEjoin3 ON (PMEjoin3.tunnus = PMEtable0.stunnus) LEFT OUTER JOIN pmp.tekotapa AS PMEjoin5 ON (PMEjoin5.ttid = PMEtable0.ttid) ORDER BY PMEtable0.maaliid

 
webmasterextraordinaire     Založený: 25.04.2006   Príspevky: 5  
Príspevok Zaslal: 2007-01-25 00:56
Návrat hore  Odpovedať s citátom     

Bumpage!

I'm having this exact problem and the last post is a bit discouraging in regards to there being a solution.

Maybe someone's found something since this thread was started?

My specific code:

$div == division code for the application user.

$opts['fdd']['forklift'] = array(
'name' => 'Forklift',
'select' => 'T',
'maxlen' => 25,
'sort' => true
);
$opts['fdd']['forklift']['values']['table']='assets';
$opts['fdd']['forklift']['values']['column']='code';
$opts['fdd']['forklift']['values']['description']='code';

The above works fine, however, if I add the following:

$opts['fdd']['forklift']['values']['filters'] = "PMEjoin2.whsnum = '$div'";

I get the following error in add/change mode:

MySQL error 1109
Unknown table 'PMEjoin2' in where clause

On the other hand, if I reference the table directly:

$opts['fdd']['forklift']['values']['filters'] = "assets.whsnum = '$div'";

I get

MySQL error 1109
Unknown table 'assets' in on clause

this occurs on the main field listing page.

Halp!

 
webmasterextraordinaire     Založený: 25.04.2006   Príspevky: 5  
Príspevok Zaslal: 2007-01-25 22:47
Návrat hore  Odpovedať s citátom     

I rolled back to version 5.5 and it works fine.

 
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