Sql match with dashes?

My database contains strings that are similar to this one: hello-world-2-425
hello-world

How to 100% find the matching string?

I mean when I search for “hello-world-2-425” it should find the one that is 100% the same not like this:

hello-world-2-42
hello-world-2-4

I am using:

WHERE a.url LIKE '%".$db->escape_string_like($mybb->input['id'])."%'

But it doesn’t work 100% sometimes returns similar ones?

What is the best way.

Thanks

What does escape_string_like do to your string? That’s not a predefined (or rather, not a PHP-defined) function.

I ma not sure! I just see sow some similar code :wink:

Then use equal sign instead of like. Like will always return results that are LIKE input value.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.