
July 3rd, 2002, 12:55 PM
|
 |
Born Looser
|
|
Join Date: Mar 2002
Location: /root
|
|
Searching
I am using the following query to search two tables on contain titles for text and second contains text. both have id as common column and I need result after searching both tilte and text.
Look at this query.
Code:
select * from topics LEFT JOIN topic_text ON topics.topic_id=topic_text.topic_id
where (topics.topic_title LIKE '%Re:%') OR (topic_text.text LIKE '%Re:%')
I do get the right result but i know this is wrong way to query a database. Do some one know a btter way to search twotable for a single thing let me know.
__________________
Kumar Chetan Sharma
-----
_SelfProcclaimedGuru
Hire a LAMP guy.
To err is human. To blame your computer for your mistakes is even more human, it is downright natural.
|