| Index
» Projekty
» phpMyEdit
» Fórum
» Filtering based on a variable |
 |
EMJeney
Založený: 10.04.2009
Príspevky: 2
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)
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
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
|
|
|
|