php - MySQL Return everything if a letter or word is matched? -
this using right now:
select * title title.posttitle '%$search%'
if searches how make apple pie
returns right thing.
if searches make apple pie
returns nothing reason.
how can make if letter or word matches returns record?
if posttitle contains $search value produce response. in point of view searching string holding multiple words not best practice. break string words (example using javascript)
var string = "my sample sentence"; var words = str.split(" ");
and search if contains words
select * title (title.posttitle '%words[0]%') , (title.posttitle '%words[1]%') ...etc
storing data in 1 format db search (all lowercase or uppercase)
Comments
Post a Comment