php - Inner join between three tables to get info -


from beginning used code go table a(category) b(joined)

$query = "select *       joined     inner join category     on joined.categoryid = category.categoryid 

now have made third table called 'userticket'. 'userticket' table have column called 'jid' foreign key column called 'jid' in joined table. basiaclly easy me show 'jid' on 'usertickets' table numbers, how join tables can go table b c can info table (category) onto c (userticket)?

try code:

select *     joined j   inner join category c on (c.categoryid = j.categoryid)   inner join userticket u on (u.jid = j.jid); 

you can remove alias think it's better clear code.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -