php - Query data from 3 tables -
i have 3 table here :
+ _news : id, title, url, image // table contents data of news. + _block : bid, id // table content id of news , bid + _block_cate : bid, title, url // table content type of news : php, sql, html
the data of each table :
+ _news : id, title, url, image 1 title1 url1 image1 2 title2 url2 image2 + _block : bid, id // id here if of news. 1 1 2 1 1 3 + _block_cate : bid, title, url // table contents data of each type. 1 php php 2 sql sql 3 html html
i try print homepage result :
- news (1) - title
type : php,sql
news (2) - title 2
- type : html
i tried 2 level query not work. idea query ?
// can check demo here http://blogtruyen.com/trangchu trying make webpage that. each manga show theirown info , type belongs to. hope can give me advise.
i not clear question need.i think need this.
select nw.title,* _news nw left join _block bk on nw.id=bk.id left join _block_cate bc on bk.bid = bc.bid
Comments
Post a Comment