Jump to content

php to select LIKE


bschultz

Recommended Posts

I'm trying to write a select to match a few certain words...

 

$sql = "SELECT * FROM podcasts WHERE `type` = 'podcast' AND recap LIKE 'Men%' AND recap LIKE '%Hockey%' ORDER BY date DESC";

 

That's what I have so far...which isn't working...

 

I need to match the string "Mens" OR "Men's" with the word "Hockey"

 

BUT...I can't match "Women's" or "Womens"

 

Any idea what I'm doing wrong?

 

The above code only returns 6 results...when it should return nearly 100.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/255461-php-to-select-like/
Share on other sites

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.