Azaz Posted July 22, 2010 Share Posted July 22, 2010 $search = "`title` LIKE '%Silvin AND wts%'"; I want to search for both of those keywords why not work? Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/ Share on other sites More sharing options...
dezkit Posted July 22, 2010 Share Posted July 22, 2010 SELECT * FROM `table` WHERE `row` LIKE '%Silvin%' AND `row` LIKE '%wts%' Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089437 Share on other sites More sharing options...
Alex Posted July 22, 2010 Share Posted July 22, 2010 SELECT * FROM `table` WHERE `row` LIKE '%Silvin%' AND `row` LIKE '%wts%' I think you mean OR instead of AND. Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089438 Share on other sites More sharing options...
dreamwest Posted July 22, 2010 Share Posted July 22, 2010 You can also use MATCH `field` AGAINST('{$query}') Which is alot faster than scanning the database with `field` like '%{$query}%' Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089439 Share on other sites More sharing options...
dezkit Posted July 22, 2010 Share Posted July 22, 2010 SELECT * FROM `table` WHERE `row` LIKE '%Silvin%' AND `row` LIKE '%wts%' I think you mean OR instead of AND. OP asked for AND lol Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089440 Share on other sites More sharing options...
Azaz Posted July 22, 2010 Author Share Posted July 22, 2010 You can also use MATCH `field` AGAINST('{$query}') Which is alot faster than scanning the database with `field` like '%{$query}%' who says it's faster? do you have proof? your nothing to me w/o proof Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089445 Share on other sites More sharing options...
dreamwest Posted July 22, 2010 Share Posted July 22, 2010 You can also use MATCH `field` AGAINST('{$query}') Which is alot faster than scanning the database with `field` like '%{$query}%' who says it's faster? do you have proof? your nothing to me w/o proof HA! nice try - im not writing the script for you. The only proof you need is my experience with large databases Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089448 Share on other sites More sharing options...
Azaz Posted July 22, 2010 Author Share Posted July 22, 2010 You can also use MATCH `field` AGAINST('{$query}') Which is alot faster than scanning the database with `field` like '%{$query}%' who says it's faster? do you have proof? your nothing to me w/o proof HA! nice try - im not writing the script for you. The only proof you need is my experience with large databases ?? I'm not looking for the exact find anyway, your are nothing to me (Im talking about your post) when u decide to put in a statement that might be biased, sorry. Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089449 Share on other sites More sharing options...
dreamwest Posted July 22, 2010 Share Posted July 22, 2010 ?? I'm not looking for the exact find anyway, your are nothing to me (Im talking about your post) when u decide to put in a statement that might be biased, sorry. Your funny! But enough with the comedy man.......Your kidding about which is faster right? Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089456 Share on other sites More sharing options...
Azaz Posted July 22, 2010 Author Share Posted July 22, 2010 ?? I'm not looking for the exact find anyway, your are nothing to me (Im talking about your post) when u decide to put in a statement that might be biased, sorry. Your funny! But enough with the comedy man.......Your kidding about which is faster right? I dont need to match the right kind. I need to Like. clause. Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089458 Share on other sites More sharing options...
dezkit Posted July 22, 2010 Share Posted July 22, 2010 Azaz you like totally ignored my post, which is also the second post in this thread. Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089462 Share on other sites More sharing options...
Azaz Posted July 22, 2010 Author Share Posted July 22, 2010 Azaz you like totally ignored my post, which is also the second post in this thread. Yea, I got that, thank you!! I am just curious on why he thinks the other way is faster and it'snot finding like it's finding the exact which i don't need in the first place,lol Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089468 Share on other sites More sharing options...
dreamwest Posted July 22, 2010 Share Posted July 22, 2010 Azaz you like totally ignored my post, which is also the second post in this thread. Yea, I got that, thank you!! I am just curious on why he thinks the other way is faster and it'snot finding like it's finding the exact which i don't need in the first place,lol How old are you? 12yo? SELECT * FROM `table` WHERE `row` LIKE '%Silvin%' OR `row` LIKE '%wts%' and SELECT * FROM `table` WHERE MATCH `row` AGAINST( 'Silvin wts') Will produce the same result....except MATCH doesnt have to scan the database to find a like and it IS faster BOOYA! Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1089476 Share on other sites More sharing options...
Azaz Posted July 30, 2010 Author Share Posted July 30, 2010 Azaz you like totally ignored my post, which is also the second post in this thread. Yea, I got that, thank you!! I am just curious on why he thinks the other way is faster and it'snot finding like it's finding the exact which i don't need in the first place,lol How old are you? 12yo? SELECT * FROM `table` WHERE `row` LIKE '%Silvin%' OR `row` LIKE '%wts%' and SELECT * FROM `table` WHERE MATCH `row` AGAINST( 'Silvin wts') Will produce the same result....except MATCH doesnt have to scan the database to find a like and it IS faster BOOYA! I wasn't asking for MATCH RESULTS BUDDY, I am asking for LIKE RESULTS. Do you really think people are perfect and say everything EXACTLY The same on forums? Even if i was 12, And learning php i'll be smarter then you when I hit your age so don't come to conclusions just yet . Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1093325 Share on other sites More sharing options...
Pikachu2000 Posted July 30, 2010 Share Posted July 30, 2010 Instead of acting like such an ass when someone who is trying to help you FOR FREE makes a perfectly valid suggestion, and even provides the reasons that the suggested method would be better, you should at least take the time to read the manual before spouting off when you don't know what you're talking about. You should get really familiar with Google, because you're unlikely to find people here who will be willing to help someone who behaves like you. Quote Link to comment https://forums.phpfreaks.com/topic/208514-i-want-to-search-more-in-like-clause/#findComment-1093338 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.