|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi,
I have two tables "Post" & "Reply" which (oddly enough) contain the posts and replies for a forum, like so... Post ------ id title content Reply ------ id postid reply I'm now trying to create a search facility that will not only look up the posts and match the search term against the content field, but look up both Post.content and Reply.reply and retieve the results in order of relevance with Post.title as the title. The problem is when looking up the reply table I need to cross reference the Reply.postid field with the Post.id field. I've been fumbling around with such statements as... "SELECT Jude_forum_posts.title FROM Jude_forum_posts WHERE Jude_forum_posts.id = (SELECT Jude_forum_replies.postid FROM Jude_forum_replies WHERE MATCH (Jude_forum_replies.reply) AGAINST ('$searchTerm'))" ...but not getting anywhere. I'd be really grateful if anyone could let me know where I'm going wrong? Cheers, Daniel |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Selecting from multiple tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|