Hi..
I am having problem in executing the Query below
$con= mysql_connect("localhost", "","");
$db=mysql_select_db("WebTest");
$p="\"'";
echo $p."<br>";
// name like \"%'%\" or name like '%\"%' or
$query="select * from try where name like \"$p\" or name like '$p'";
echo $query;
$r=mysql_query($query);
if (mysql_num_rows($r) >0)
{
while ($ar=mysql_fetch_array($r))
{
echo "<br> In data ".$ar[1] ."<br>";
}
}
else
{
echo "Empty";
}
The above query simple trying to display the result that can contain either " or ' or both of them. It works if the condition of 'like' is given in the $query varaible but not if done from other variable like session variable of POST or Get etc.
Any help