jonnyw6969 Posted August 20, 2008 Share Posted August 20, 2008 Hi all, Need a bit of help figuring this out. Im running a simple query on a database of about 5000 records. Its basically looking for matches on a number sequence using the like command. Prob is i have two like commands and the results are limited to 10. Here is my query SELECT * FROM number_list a JOIN website_costs b ON a.Prefix=b.Prefix AND a.Category=b.Category WHERE a.Availability = 'A' and a.Prefix = '".$prefix."' and (a.Number LIKE '%".$_REQUEST['cat']."%' or a.Number LIKE '%".$shortnum."%' ) LIMIT 10 The thing is there are results in the database that match the first like command but they dont get picked as there are results from the second like query before them. I need to be able to take all the results from the first like command first then the rest of the results from the second like command. Does this make any sense? Thanks all Quote Link to comment Share on other sites More sharing options...
Mchl Posted August 20, 2008 Share Posted August 20, 2008 Remove LIMIT 10 ? Quote Link to comment Share on other sites More sharing options...
jonnyw6969 Posted August 20, 2008 Author Share Posted August 20, 2008 but i need only ten results Quote Link to comment Share on other sites More sharing options...
fenway Posted August 20, 2008 Share Posted August 20, 2008 You want 10 from each? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.