| Index
» Projekty
» phpMyEdit
» Fórum
» Filter by login ? |
 |
guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-02 18:27
Návrat hore
Odpovedať s citátom
|
In my database each entry/row has a user's name in a field (IDLoginName). I am setting up login access using Apache .htaccess. Can someone tell me if it's possible to filter based on the login and display only those records that match in the IDLoginName? If so, what the correct filter syntax would be? Any help would be appreciated. THX.
|
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2005-06-02 19:00
Návrat hore
Odpovedať s citátom
|
How about setting a filter in your PME header file:
| Kód: |
| $opts['filters'] = "IDLoginName = {$_SERVER['PHP_AUTH_USER']}"; |
|
guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-02 20:18
Návrat hore
Odpovedať s citátom
|
Thanks for the reply. I gave it a try, here's what happened. First, 'genew' is a valid value in a couple of entries in the mysql table column 'IDLoginName'. And, the .htaccess file is in place and the passwd file contains 'genew' as a user. The login works without the filter. After adding the filter code (I added it exactly as it was in the reply), when I login as genew I get this error:
MySQL error 1054
Unknown column 'genew' in 'where clause'
|
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2005-06-02 21:35
Návrat hore
Odpovedať s citátom
|
Ah...methinks that there's an error in my suggestion. The username needs quoting. So it should probably look like:
| Kód: |
| $opts['filters'] = "IDLoginName = '{$_SERVER['PHP_AUTH_USER']}'"; |
Note the extra quotation marks.
|
guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-02 22:40
Návrat hore
Odpovedať s citátom
|
Thank You, AJH. That did the trick, it's working the why I'd hoped.
Now, if I could just get the numbers formated as currency ($1,234.56), I could be totally happy.
Thanks again for your help.
|
ajh
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2005-06-03 09:50
Návrat hore
Odpovedať s citátom
|
How about adding a 'mask' attribute to the apropriate field:
| Kód: |
| $opts['fdd']['col_name']['mask'] = '$%01.2f'; |
|
guardian46
Založený: 31.05.2005
Príspevky: 34
Zaslal: 2005-06-03 15:23
Návrat hore
Odpovedať s citátom
|
AJH,
Hey, that added the $, which is a step closer. But, since some of my numbers on in the millions, I kinda need the thousand separator comma. It would make the numbers so much easier to read. $1,234,567.89 as opposed to $12345567.89. Thanks for your help!!
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|