Jump to content

For my edification (select column using PHP) ...


phporcaffeine

Recommended Posts

I had a query like this :

SELECT col1, col2, col3 FROM tbl WHERE col5 LIKE 'myText'

and that returned an empty result set when in fact there were rows that it should have found ...

so then I googled and found something to try, when I tried this query:

SELECT col1, col2, col3 FROM tbl WHERE col5 LIKE '%myText%'

it worked.

My question is why did '%' make a difference?  I have tried to find the answer on mysql.com but no luck.

-TIA

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.