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

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -