Jump to content

[SOLVED] need help creating a search function


hypn0toad

Recommended Posts

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.