Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Nedeľa, 29. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Filtering based on a variable

phpMyEdit Configuration     Filtering based on a variable
Odoslať novú tému   Odpovedať na tému    
 
EMJeney     Založený: 10.04.2009   Príspevky: 2  
Príspevok Zaslal: 2009-04-10 23:58
Návrat hore  Odpovedať s citátom     

Is it possible for me to filter based on a variable? I want to filter the database to only show rows created by the current login. The name is stored in the column login, and the variable is conveniently named login. Here's the line:

$opts['filters'] = "login = '" + $login + "'";

However, whenever I look at the site, this has no effect on the rows displayed. I still see all of the rows in the table.

I am understanding filters correctly, right? They are appended to the WHERE clause of a database query? So, this should only show rows where the column login has the equivalent value with $login? And this should be immediately effective on the main table view, after a refresh of course?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-04-11 16:22
Návrat hore  Odpovedať s citátom     

Looks like Javascript:

EMJeney Napísal:
$opts['filters'] = "login = '" + $login + "'";


Try something like

Kód:
$opts['filters'] = 'login = "'.$login.'"';

$opts['cgi']['persist'] = array('login' => $login );


 
EMJeney     Založený: 10.04.2009   Príspevky: 2  
Príspevok Zaslal: 2009-04-11 21:05
Návrat hore  Odpovedať s citátom     

Thanks, that worked perfectly.

 
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