按用户名过滤 [英] filter by username

查看:79
本文介绍了按用户名过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清楚如何使用WHERE(或其他一些功能)来过滤当前登录的人员。例如,如果我以JollyWG身份登录并且我的表有几条记录(一列)当然包括我的用户名)如何让它过滤其他人的记录。


提前感谢您的任何反馈!


Jolly

I having trouble figuring out how to use the WHERE (or some other feature) to filter my table by the person who is currently logged in. For instance if I log in as JollyWG and my table has a few records (one column of course includes my user name) how can i get it to filter everyone else records out.

Thanks in advance for any feedback!

Jolly

推荐答案

展开 | 选择 | Wrap | 行号


如何才能显示页面被加载到gr idview?
How can I get that to display when the page is loaded into a gridview?


在这种情况下,我不会使用''LIKE''。

我会完全匹配它,因为你可能有多个用户一个类似的名字。


例如,你可能有一个名为JollyWG的用户。并且您可能有一个名为Jolly的用户。如果您使用LIKE username =" Jolly",则两者都是JollyWG。和快乐将被退回。这可能不是你想要的。


我建议:
I wouldn''t use ''LIKE'' in this case.
I would match it exactly because you may have more than one user with a similar name.

For example, you may have a user named "JollyWG" and you may have a user named "Jolly". If you use LIKE username = "Jolly", both "JollyWG" and "Jolly" will be returned. This is probably not what you want.

I recommend:
展开 | 选择 | Wrap | 行号


这篇关于按用户名过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆