Question

here is the sql codes

SELECT
roles.role_id,
usertype_module.role_id,
usertype_module.viewable,
usertype_module.editable,
usertype_module.createable,
modules.modules_id,
usertype_module.modules_id,
modules.modules,
roles.role_name
FROM
modules ,
roles
INNER JOIN usertype_module ON roles.role_id = usertype_module.role_id AND usertype_module.modules_id = modules.modules_id

and this error showed Unknown column 'modules.modules_id' in 'on clause'

pls help me thanks

Was it helpful?

Solution

Might be a mistake in the query. Is this what you are trying to do:

SELECT
roles.role_id,
usertype_module.role_id,
usertype_module.viewable,
usertype_module.editable,
usertype_module.createable,
modules.modules_id,
usertype_module.modules_id,
modules.modules,
roles.role_name
FROM
roles
INNER JOIN usertype_module ON roles.role_id = usertype_module.role_id 
INNER JOIN modules ON usertype_module.modules_id = modules.modules_id
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top