Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Contributor
Posts: 15
Registered: ‎05-16-2011
My Device: Blackberry 8900
My Carrier: IND Telkomsel

Parsing parameter using HTTP Post and get the JSON string

I have this php code to parse SQL Database into JSON String :

 

<?php

mysql_connect("localhost","root","");
mysql_select_db("db");

$q=mysql_query("SELECT * FROM product WHERE brandID='".$_REQUEST['brand']."' AND genderID='".$_REQUEST['gender']."' AND categoryID='".$_REQUEST['category']."'");

while($e=mysql_fetch_assoc($q))
       $output[]=$e;

print(json_encode($output));

mysql_close();

?>

 

Anybody know how to parsing parameter "brand", "gender", and "category" from BB app?

And how to get the JSON string from that php result so that I can process the data?

 

thanks Smiley Very Happy

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Parsing parameter using HTTP Post and get the JSON string

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Parsing parameter using HTTP Post and get the JSON string

And you will have to issue an HTTP query to get the php script running.  Something like the httpDemo sample which should be included in your tooling, will help you create this.