Hi, (mysql, php question) The table is something like below: field1 field2 field3 I need to search "field1" and sort by "field2". I know the query for that, but here's a problem: The search term is "hello jeet", (2 words) How do I search for first word, and then search for word2 and sort the "final" result by field2? I think I'll need a temporary table in between. Is that right? If there's an easier way of doing this, then please let me know. (with array, or some query I'm forgetting about...) Please note that the "final" output needs to be sorted on field2. Doesn't matter which word is searched first and so on. Plus there can be more than 2 words... Thanks jeet
select field1, field2, field3 from table1 where field1 like ('an%') or field1 like ('al%') or field1 = 'test' order by field2