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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -