Jump to content

[SOLVED] MYSQL issue, Select ... Where ... please help.


shlomikalfa

Recommended Posts

as the title mentioned i have an issue running a MySQL command, i want to make a search in my db for only but even one of the words in a certain collumn.

 

- eg:

DB: MyDB1
Collumn: Titles
Titles-0: Heroes.Season2.Episode1
Titles-1: Heroes.Season2.Episode2
Titles-2: Heroes.Season2.Episode3
Titles-3: Prison-Break.Season3.EP4

 

i want the command to retrive any title which has the word "heroes" in it.

Not working with these two:

SELECT HIGH_PRIORITY * FROM downloads WHERE `downloads`.`Title` LIKE "heroes"
SELECT HIGH_PRIORITY * FROM downloads WHERE `downloads`.`Title` = "heroes"

"SELECT * FROM downloads WHERE `downloads`.`Title` LIKE '%heroes%'";

The percentage signs tell the database to search for any match of the search word.

 

Using both percent sings searches a match anywhere in the string

Using one to left looks for words starting with the search string

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.