android - how to pass and fetch data when using ampersand in sql -


im trying pass url fetch data android json. 

the url is: fetch_cat_url = "xxx/get_product_details.php?task_name=get_cat&cat_name="+cat_name;

where cat_name="books & more" when pass url.. goes  xxxxx/get_product_details.php?task_name=get_cat&cat_name=books & more  in sql file switch($_get["cat_name"])         {             case "fashion":             $sql = "select * `category` c_name in (\"men\",\"women\" ,\"baby & kids\") ";             break;              case "home & living":             $sql = "select * `category` c_name in (\"kitchenware\", \"home furnishing\", \"home decoratives\", \"furniture\") ";             break;              case "books & more":             $sql = "select * `category` c_name in (\"academic text\", \"literature & fiction\", \"non fiction\", \"self help\", \"children & young adult\", \"competitive exam\") ";             break;              case "automotives":             $sql = "select * `category` c_name in (\"car accessories\", \"helmets & accessories\", \"car & vehical electronics\", \"car freshners\", \"spare parts\") ";             break;         }  & data not returned in json.. returns rest categories... 

data returns fashion , automotives not books , home

while passing cat_name in json client side make sure json string should encoded .

string jsonstring = uri.encodedatastring(json) 

now pass jsonstring server.. may full.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -