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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -