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"

Link to comment
Share on other sites

"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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.