Quote:
Originally Posted by drclockwork
tl;dr: the code snippets.
It's been a little while since I've had to do any heavy lifting with MySQL, but if I recall correctly, when you use % in your database query, it assumes that you're looking for something before the beginning of the string. Therefore anything that starts with your string, and nothing before it, it will return 0 results.
|
That is incorrect.
https://dev.mysql.com/doc/refman/5.0...functions.html
% matches any number of characters, even zero characters.
from our examples above:
sql=Select id, url, title from test_table where title LIKE '%transvestite threesome tea party%'
when we go to execute that we get back a:
Sql returned 1 rows
Rec 1 Title: transvestite threesome tea party matched