mysql query

there are total 3 tables

tablenames:                                mdl_course_categories                                      mdl_role_assignments                                  mdl_context

fields:                                              id  ,    categoryname                                                userid   ,    contextid                                 id  ,   instanceid

so i need  to display userids  with their  category names…………….

in   mdl_course_categories    id   means  category id          and      mdl_context     id    means    contextid

You can leave a response, or trackback from your own site.

One Response to “mysql query”

  1. prasad says:

    Hello hairsh,

    Here is the query can works for u.

    select mra.userid,mca.categoryname from mdl_role_assignments mra,mdl_context mc,mdl_course_category mcc
    where mra.contextid=mc.id and mc.instanceid=mcc.id

Leave a Reply

You must be logged in to post a comment.