Search form and substring_index

it appears you have applied the functions incorrectly

for example, this –

SUBSTRING_INDEX('search_new', '_', -1)

simply pulls out the string ‘new’ because it’s operating on the string ‘search_new’

what you want is to have the function operate on the actual contents of the form field instead

that’s an issue for how you construct the sql in your php app

p.s. your table alias is PF but you use PP on your columns --that’s a paddlin’