vicodin Posted February 26, 2008 Share Posted February 26, 2008 Ok so this is what i need to do. I am programming a search engine for my site and pretty much this is how i think i should work but not quiet sure how to do it. 1.User Submits a query.(i can code this part) 2. If the query has a white space in it break it into an array. example query ="Playstation 3" It would put playstation and 3 in an array (i can code this part). 3.Go into my database and look at all the products keywords and but them in an array. (I can code this as well) 4.Check my first array against the db array and if they match then output the product stop checking this array against my first array and go the next products keywords until there is no more products. (This is what i dont know how to do. Pretty much the only thing i dont know how to do is the stuff in bold.) Any help would be much appreciated. Thanks all. Your Friendly Neighborhood Narcotic - Vic. Link to comment https://forums.phpfreaks.com/topic/93062-match-2-arays-against-each-other/ Share on other sites More sharing options...
DarkerAngel Posted February 26, 2008 Share Posted February 26, 2008 <?php mysql_query("SELECT * FROM products WHERE MATCH(keywords) AGAINST('$keyword') ORDER BY score DESC"); ?> Set your keywords to full text and give that a whirl Link to comment https://forums.phpfreaks.com/topic/93062-match-2-arays-against-each-other/#findComment-476794 Share on other sites More sharing options...
vicodin Posted February 26, 2008 Author Share Posted February 26, 2008 I need to keep my keywords in my database to one cell and so they are separated by a |. Link to comment https://forums.phpfreaks.com/topic/93062-match-2-arays-against-each-other/#findComment-476800 Share on other sites More sharing options...
DarkerAngel Posted February 26, 2008 Share Posted February 26, 2008 well with full text you can just have information in there like "Playstation 3 PS3 Sony Play Station SixAxis" and it will still return that result if I entered "PS3 SixAxis" into a search string Link to comment https://forums.phpfreaks.com/topic/93062-match-2-arays-against-each-other/#findComment-476809 Share on other sites More sharing options...
vicodin Posted February 26, 2008 Author Share Posted February 26, 2008 Really??? Wow didnt know that... Thanks Link to comment https://forums.phpfreaks.com/topic/93062-match-2-arays-against-each-other/#findComment-476813 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.