MySQL LIKE '%...%' query won't work
#1

Hi there,

i've work on it a long time and it will not work (I use StrickenKids MySQL Plugin).

I tested these query
Код:
SELECT * FROM `help` WHERE `searchWord1` LIKE '%%s%' LIMIT 0 , 30
For example i type in "hous", it should look like this
Код:
SELECT * FROM `help` WHERE `searchWord1` LIKE '%hous%' LIMIT 0 , 30
I tested a lot of methods, for example this one:

Код:
SELECT * FROM `help` WHERE `searchWord1` LIKE '% %s %' LIMIT 0 , 30
This will printed in this form: "% hous %", but the mysql-database don't know what to do with it.

I have saved "house" in searchWord1, i want to make a search system on my server.
The database should also find the content when I use the name of the column specified imprecise.

When i type in "hous" as a search-word it should find the content with "house" (with the sql field in phpmyadmin it works perfectly, but not with mysql_query, - maybe it lay on the strings?).

I've printed it and this will come out:

Код:
SELECT * FROM `help` WHERE `searchWord1` LIKE '%s' LIMIT 0 , 30
(only the percent and the S, not the string which i have defined!)

Thanks for help, sorry for my bad english.
Reply


Messages In This Thread
MySQL LIKE '%...%' query won't work - by tMike - 06.06.2012, 15:01
Re: MySQL LIKE '%...%' query won't work - by Calgon - 06.06.2012, 15:04
AW: MySQL LIKE '%...%' query won't work - by tMike - 06.06.2012, 15:10

Forum Jump:


Users browsing this thread: 1 Guest(s)