0

Hi frnds...

here i m doing search for my website...

$mcat='abc';

$query="SELECT * FROM news WHERE topic LIKE '%$mcat%' ";

here , the problem is in my db table $mcat value stored as doublequotes ...the word itself having double qoutes....

the above query working for all other sarch items, except double quotes words...plz give me some suggestions...

Thanks in advance...
Saritha...

Edited by sarithak: n/a

3
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by sarithak
0

you can even change the table to one without a quotation mark. hope it helps.shalom shalom

0
$mcat = mysql_real_escape_string($mcat);
$query="SELECT * FROM news WHERE topic LIKE '%$mcat%' ";
0
$mcat = mysql_real_escape_string($mcat);
$query="SELECT * FROM news WHERE topic LIKE '%$mcat%' ";

Hi ...

I already test mysql_real_escape_string($mcat)...but not working...
In my db th first letter if having "...
eg:

"hi" welcome...


but $mcat= 'hi';

it doesnt search...

0

sorry i don't agree with it, if the search string is 'hi' like $var = 'hi' and in your db there are below entries -
1.high
2.hi
3."hi!
4."hi"

all these will come in the query's result if done with -
mysql_query("select * from tbl where fieldName like '%".$var."' ");

Edited by network18: n/a

0

sorry i don't agree with it, if the search string is 'hi' like $var = 'hi' and in your db there are below entries -
1.high
2.hi
3."hi!
4."hi"

all these will come in the query's result if done with -
mysql_query("select * from tbl where fieldName like '%".$var."' ");

Hi Network...i got it...

Thanks...i mis used ur suggestion...

now ok..its working...
Thanks once again...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.