简体   繁体   English

SQL检查用户激活和激活的Joomla 2.5

[英]SQL check user activated and active Joomla 2.5

I have an complex sql query and i would like to check if user is active and activated in WHERE clause 我有一个复杂的SQL查询,我想检查用户是否在WHERE子句中处于活动和激活状态

The query is running on a joomla 2.5 该查询正在joomla 2.5上运行

Can someone explain me which fields Joomla uses/edits to activate a user and how can I do that ? 有人可以解释一下Joomla使用/编辑哪些字段来激活用户,我该怎么做?

SELECT u.id 
FROM #__users u
WHERE
-- [many clauses]
AND 
[user is activated and active] 

In the #__users database table, you will see a column called activation . #__users数据库表中,您将看到一列称为Activation的列。

  • empty = activated =已激活
  • string = still requires activation 字符串 =仍需要激活

So in your query, you can simply use: 因此,在查询中,您可以简单地使用:

AND activation = null

Just for reference, I hope you're using Joomla methods for your database query and not native SQL ;) 仅供参考,我希望您对数据库查询使用Joomla方法,而不是本机SQL;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM