php - MySQL selecting from multiple tables -


im trying select data multiple tables, fine doing 2 tables query so:

$myquery = sql_query(     "select a.object_title, a.published_by, b.userid      table1       join table2 b on (a.published_by = b.userid)" ); 

but see now, want select data third table, third table not have relationship such primary key between first 2 tables, want pull data , form sort of link "join".

how add third query?

thanks

you use cross join :

$myquery = sql_query(     "select a.object_title, a.published_by, b.userid, c.whatever      table1       join table2 b on (a.published_by = b.userid)      cross join table3 c" ); 

i used this other post find idea.

more infos here.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -