Help......Passing Search string containing single quotes
Posted: Mon Mar 19, 2007 6:49 pm
Hi I am trying to write a code that is simple..I will pass a variable $word and it will search all the rows in a MySql table.
Now If the string in $word contains single quote(') then it is creating problem.
Please help me It is very important...
Now if $string ="Citta' " then it will create problem.....
Now If the string in $word contains single quote(') then it is creating problem.
Please help me It is very important...
Code: Select all
$string=$_POST['name'];
$query="select * from Words where Word='$string'";
$result=mysql_query($query);