Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query help to combine mutiple records and tables

Status
Not open for further replies.

leegold2

Technical User
Oct 10, 2004
116
Not sure if I should post in php or here, but to me it's gnarly SQL so I guess I should post here.

$query = "SELECT page.*, url_pages.* FROM `page` LEFT JOIN `keywords` USING(`page_id`) LEFT JOIN URL_PAGES USING (`page_id`) WHERE MATCH(`keywords`.`keyword_txt`) AGAINST ('$keyword'IN BOOLEAN MODE)";

I got a keyword table, the fulltext finds the word in the keywords table and relates the page_id field to identical fields in the page table and the url table.

keyword table
page_id keyword
1 foo

page table
page_id title description
1 my urls It' my webpage

url table
page_id url
1 goglle1.com
1 goglle2.com

I want *one reord* rendering like this:

my urls It' my webpage goglle1.com goglle2.com

ie. the user sees one record

BUT in my mysql/php attempts i get this rendering:
my urls It' my webpage goglle1.com
my urls It' my webpage goglle2.com

What's the strategy to combine into *one* record? I can split things up into two separate querys? I need help. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top