I have a blood group data in a member table [A-,A+,B+,B-,AB+, AB-,O+,O-] I have a search feature which allows me to select above blood groups and search for the member who has the selected blood group. But my query is not fetching me the members who has the blood group ending with "+". Same query is working fine for the members having the blood group "-".
Then i am passing the query result to a javascript url which fetches the final query results. So I feel javascript variable is putting an end when it get's +. So how to manage this?
This is my query:
$bldgroup = mysql_real_escape_string($_POST["bldgroup"]);
$sqlsearch = mysql_query("SELECT * from member
WHERE blood_group='$bldgroup'
ORDER BY memid ASC");
<script>
var url = "../include/query.php?flag=search&&query="+sqlsearch;
</script>
<div><label>Blood Group</label></div>
<div>
<select id="bldgroup" name="bldgroup" >
<option value="">Select</option>
<option value="A+">A+</option>
<option value="A-">A-</option>
<option value="B+">B+</option>
<option value="B-">B-</option>
<option value="AB+">AB+</option>
<option value="AB-">AB-</option>
<option value="O+">O+</option>
<option value="O-">O-</option>
</select>
</div>
</div>
//This the content inside ./include/query.php file
if(isset($_REQUEST["flag"]))
{
$list = $_REQUEST["flag"];
if($list == "search")
{
$query = $_REQUEST["query"];
$sql = $query;
$sql.= mysql_query" ORDER BY t1.MemberID DESC";
}
}