Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use views for login and enable register end-point #907

Closed
mevdschee opened this issue Sep 8, 2022 · 2 comments
Closed

use views for login and enable register end-point #907

mevdschee opened this issue Sep 8, 2022 · 2 comments
Assignees

Comments

@mevdschee
Copy link
Owner

Is it possible to use views for login and also enable register end-point? I've successfully used views to login active users but the register endpoint is now throwing error.

<b>Fatal error</b>: Uncaught PDOException: SQLSTATE[HY000]: General error: 1471 The target table active_users of the INSERT is not insertable-into in ...

My view contains a join between the users table and roles table

select id, username, password,is_active, role_id 
from users left join roles on roles.id = users.role_id 
where is_active = 1
and role_id <> 0

Originally posted by @dswdcares in #892 (comment)

@mevdschee mevdschee self-assigned this Sep 8, 2022
@mevdschee
Copy link
Owner Author

mevdschee commented Sep 8, 2022

@dswdcares If your view is insertable-into you can. If not, then you can't. In your case your view is not insertable-into.

@mevdschee
Copy link
Owner Author

closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant