hypn0toad Posted January 5, 2008 Share Posted January 5, 2008 so i'm creating a search page for a website i'm working on and am making a search page. right now i'm just using a like statement. SELECT movies_id, movies_name, movies_date, movies_showing, movies_location, movies_free FROM movies WHERE movies.movies_name LIKE "north by northwest" problem is that it doesnt return good enough results. if the search term is "north" nothing shows up, "north by northwest" has results so i looked into alternative ways to do the search so that it would check each word in the column.. and didnt find great results. i think this would work $query = "SELECT movies_id, movies_name, movies_date, movies_showing, movies_location, movies_free FROM movies WHERE MATCH (movies_name) AGAINST('".$q."')"; buttt i dont think this works with my version of mysql- it requires FULLTEXT type for the column, and i can't select it in phpmyadmin. according to phpmyadmin i'm running Server version: 3.23.56-max-log (at least i assume this is the mysql version). any suggestions on how i could create this query? preferably i wouldn't have to modify the database.. i'm just trying to match titles. thanks for any possible help! Link to comment https://forums.phpfreaks.com/topic/84584-solved-need-help-creating-a-search-function/ Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 You're forgetting an important part of LIKE, the % SELECT movies_id, movies_name, movies_date, movies_showing, movies_location, movies_free FROM movies WHERE movies.movies_name LIKE "%north%" Link to comment https://forums.phpfreaks.com/topic/84584-solved-need-help-creating-a-search-function/#findComment-431029 Share on other sites More sharing options...
hypn0toad Posted January 5, 2008 Author Share Posted January 5, 2008 wow. that was easy.. i feel like an idiot anyways i guess i should have posted before looking everything up more. thanks a ton! Link to comment https://forums.phpfreaks.com/topic/84584-solved-need-help-creating-a-search-function/#findComment-431030 Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 I like the easy one's Link to comment https://forums.phpfreaks.com/topic/84584-solved-need-help-creating-a-search-function/#findComment-431031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.