我正在尝试创建一个安全的会话管理,其中每个用户都会获得一个哈希,如果用户在其他地方登录,那么它会检查用户是否拥有最近登录的哈希。这样,如果用户忘记登出,系统会替他们登出帐户。这是我写的 sql 语句,它给了我这个错误。有人能告诉我为什么吗?
谢谢
"SELECT * FROM 'v_pos_user_session WHERE userID='$userID' AND hash='$hash' AND admin='0' time=(SELECT max(time) FROM v_pos_user_session WHERE userID='$userID' AND admin='0')"
QLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'time=(SELECT max(time) FROM v_pos_user_session WHERE userID='6' AND admin='0')' at line 1