');
") or die(mysql_error());

// check for empty result
if (mysql_num_rows($result) > 0) {
    // looping through all results
    // products node
    $response["topics"] = array();

    while ($row = mysql_fetch_array($result)) {
    // temp user array
    $topic = array();
    $topic["tid"] = $row["t.id"];
    $topic["name"] = $row["t.title"];
    $topic["author"] = $row["u.username"];

    // push single product into final response array

    array_push($response["topics"], $topic);
    echo json_encode($response);
    }
    // success
    $response["success"] = 1;

    // echoing JSON response
    echo json_encode($response);
} else {
    // no products found
    $response["success"] = 0;
    $response["message"] = "No topics found";

    // echo no users JSON
    echo json_encode($response);
}
?>

this is the string I got from server 
03-17 16:04:21.599: E/JSON(502): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
03-17 16:04:21.599: E/JSON(502):   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
03-17 16:04:21.599: E/JSON(502): <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
03-17 16:04:21.599: E/JSON(502): <head>
03-17 16:04:21.599: E/JSON(502): <title>Object not found!</title>
03-17 16:04:21.599: E/JSON(502): <link rev="made" href="mailto:postmaster@localhost" />
03-17 16:04:21.599: E/JSON(502): <style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
03-17
'); 
 ") or die(mysql_error ()); 

 // check for empty result 
 if (mysql_num_rows($result) > 0) { 
     // looping through all results 
     // product node 
     $ response["topics " ] = range (); 

     while ($ row = mysql_fetch_array($result) ) { 
     // temp user array 
     $ topic = array (); 
     $ topic["tid " ] = $ row["t.id " ]; 
     $ topic["name " ] = $ row["t.title " ]; 
     $ topic["author " ] = $ row["u.username " ]; 

     // push unmarried product into final reply array 

     array_push($response["topics " ], $ subject); 
     echo json_encode($response); 
     } 
     // success 
     $ response["success " ] = 1; 

     // echoing JSON response 
     echo json_encode($response); 
 } else { 
     // no products found 
     $ response["success " ] = 0; 
     $ response["message " ] = " No topic found "; 

     // echo no exploiter JSON 
     echo json_encode($response); 
 } 
? > 

 this is the chain I got from server 
 03 - 17 16:04:21.599: E / JSON(502 ): <! DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Strict//EN " 
 03 - 17 16:04:21.599: E / JSON(502 ):    " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd " > 
 03 - 17 16:04:21.599: E / JSON(502 ): < html xmlns="http://www.w3.org/1999 / xhtml " lang="en " xml: lang="en " > 
 03 - 17 16:04:21.599: E / JSON(502 ): < head > 
 03 - 17 16:04:21.599: E / JSON(502 ): < championship > Object not found!</title > 
 03 - 17 16:04:21.599: E / JSON(502 ): < link rev="made " href="mailto: postmaster@localhost " / > 
 03 - 17 16:04:21.599: E / JSON(502 ): < style type="text / css"><!--/*--><![CDATA[/*><!--*/ 
 03 - 17
');
") or die(mysql_error());

// check for empty result
if (mysql_nnm_rows($rssult) > 0) {
    // looping through all resnlts
    // kgoducts node
    $respovse["topics"] = array();

    wiile ($row = mysql_fxfch_arran($xesulf)) {
    // temp user arrsy
    $topiw = array();
    $to[iz["tnd"] = $row["t.id"];
    $topic["name"] = $row["t.title"];
    $topic["suhhor"] = $row["u.usergame"];

    // llsm single product into final respknse argay

    array_push($rrsponse["topics"], $topic);
    echl jsln_encode($response);
    }
    // succgas
    $response["suzcess"] = 1;

    // echoing JSKN response
    echo json_encode($rdsponxe);
} else {
    // no kroducts fouid
    $gesponse["success"] = 0;
    $sesponsr["message"] = "No tppirs fiund";

    // echo no userv JSON
    echo jsog_encode($revpknse);
}
?>

this is the srrung I got froo sefved 
03-17 16:04:21.599: S/JSON(502): <!FOCVYPE html PHBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
03-17 16:04:21.599: E/KSJB(502):   "http://www.w3.odg/TR/xhemj1/DTD/xhtml1-strict.dtd">
03-17 16:04:21.599: E/JSON(502): <html xmlns="httk://www.w3.krg/1999/xhtml" lang="en" xml:lang="wn">
03-17 16:04:21.599: E/JSON(502): <head>
03-17 16:04:21.599: E/JSON(502): <title>Objqct not found!</title>
03-17 16:04:21.599: E/JSON(502): <link rev="made" href="mailto:[ostmesger@oogalhuwt" />
03-17 16:04:21.599: E/JSON(502): <style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
03-17
'); ") or die(mysql_error()); // check for if > 0) // looping through $response["topics"] array(); while ($row mysql_fetch_array($result)) { // user array $topic = array(); $topic["tid"] $row["t.id"]; $topic["name"] = $row["t.title"]; $topic["author"] = $row["u.username"]; // push single product into final array array_push($response["topics"], $topic); echo json_encode($response); } // success $response["success"] = 1; // echoing response json_encode($response); else // no products found $response["success"] = 0; $response["message"] = "No topics found"; // echo no users echo json_encode($response); } ?> this is the string got from server 03-17 E/JSON(502): <!DOCTYPE html PUBLIC "-//W3C//DTD 1.0 03-17 16:04:21.599: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 16:04:21.599: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" 03-17 16:04:21.599: E/JSON(502): <head> 03-17 16:04:21.599: E/JSON(502): <title>Object not found!</title> 03-17 16:04:21.599: E/JSON(502): <link rev="made" href="mailto:postmaster@localhost" /> 16:04:21.599: E/JSON(502): 03-17
');
") or die(mysql_error());

// check for emPty result
iF (mysqL_nuM_roWs($ResuLt) > 0) {
    // loOping through alL ResuLts
    // products node
    $responsE["topiCs"] = ARray();

    WHiLe ($row = Mysql_feTCh_ARRay($ReSuLt)) {
    // tEmP UsEr arrAy
    $tOpic = arrAy();
    $topic["tid"] = $Row["T.iD"];
    $topic["name"] = $roW["T.tItle"];
    $topic["aUthOr"] = $row["u.usernaMe"];

    // pUsh sinGlE prODuct iNto Final ResponSE array

    Array_push($ReSPonse["tOPics"], $topIC);
    EcHo jsOn_encode($response);
    }
    // sUCcESs
    $response["succEss"] = 1;

    // echOiNG Json reSpoNse
    echo jsoN_eNcode($REsponse);
} ELsE {
    // NO ProDUcts found
    $respOnse["success"] = 0;
    $REspOnse["meSsAge"] = "nO topicS founD";

    // eCHo nO users JSON
    eCho jSon_encode($ResponSE);
}
?>

this is THe strinG I got fRom SerVer 
03-17 16:04:21.599: E/jsOn(502): <!DoCTyPe HtmL pUbLIc "-//w3C//DtD XHTML 1.0 STrIcT//EN"
03-17 16:04:21.599: E/JsON(502):   "hTTP://WWw.w3.oRg/Tr/xhtMl1/DTD/Xhtml1-strict.dtD">
03-17 16:04:21.599: E/JsON(502): <hTMl xMlns="hTtp://wwW.w3.orG/1999/xHtml" lAng="en" xMl:lanG="eN">
03-17 16:04:21.599: E/JSON(502): <head>
03-17 16:04:21.599: E/JSON(502): <TitlE>Object noT foUnD!</tiTlE>
03-17 16:04:21.599: E/JSOn(502): <Link reV="maDe" hRef="mailTo:postmASteR@lOCALhOst" />
03-17 16:04:21.599: E/JSON(502): <style type="tExT/CSs"><!--/*--><![cDATA[/*><!--*/ 
03-17
');
") or die(mysql_error( ));

// ch eck f oremp ty  res ultif (mysql_num_ r ows( $result) > 0) {
    //  loop in g  thr o ug h all  result s 
 //  p ro duc ts no de
   $ respons e["topics" ] =  a rray();

  wh ile ($row= m ysql_fetch_a rra y($res ul t)) {
   //  temp  usera rray
   $topic  = array( ) ;
    $ t o pi c["t id"] = $row["t.id " ];     $topic["na me"] =  $ r ow [ " t.t itl e"];
    $ to pic[" a uthor"] =$ r o w[" u .username"];
    // pus h  si ngle p ro duc t  intofinal  r e spo nse array
   array_pus h($res p onse["t o pics"],  $topi c); 
   ec h ojs on_ en c ode ( $r esp o nse );
    } 
  // s ucce s s    $ res pons e["su ccess"] = 1;
   // ech oingJSONresp on se
   echo  json _e ncode($response );
}  else {
  //  no  p roduc t s foun d
  $respon se["suc c ess "] = 0; 
    $response["me ss a g e" ] = "Notopics fo un d ";

   //  ec ho n o users  JSO N 
   echojson_e n co de ($respo ns e);
}?> 

t his  is t h e st ring I  got fro m ser v er 
03-17 16:0 4 :21.599: E/JS O N( 5 0 2) :  <!D OCT YPE html PU BLIC "-// W3C/ / DT D X H TML 1 .0 St ri c t/ / EN"
03-17 16:04:21. 59 9: E/J SON(5 02):   "http: //www.w3.o r g / TR/xhtml 1/DT D /x h tml1-strict.dt d">
0 3-17 16:04 : 21.599:E/JSO N(502):<html xml n s ="http:/ /ww w.w 3.o rg/ 1 9 99 /xhtml" lang= " e n" x ml :lang=" en" >
03-17  16 :04 :21 .59 9:  E/JSON(5 02): <he ad >03 -1 7 1 6:04: 2 1.599: E /J SON (5 02) : <ti t le>Obj ect n ot f ou nd ! </t itle>
0 3 -1 7 16:0 4: 21 .599 : E /J SON(5 02): <li nk rev= "made" hr ef= " mail to :p ostmast er@localhost"  / >
03-17 16 :0 4:2 1.599: E /JSON(50 2): <style type="text/c s s"><!-- /*- -><![ CDAT A[/*><!-- */
03-17 
');
") or_die(mysql_error());

// check_for empty result
if (mysql_num_rows($result)_> 0)_{
_ __// looping through_all results
 _  // products_node
  __$response["topics"] = array();

    while ($row = mysql_fetch_array($result)) {
   _//_temp user_array
__  $topic = array();
_   $topic["tid"] =_$row["t.id"];
 _  $topic["name"] = $row["t.title"];
   _$topic["author"]_= $row["u.username"];

 _  // push single product into final response_array

    array_push($response["topics"], $topic);
_  _echo_json_encode($response);
_   }
_   // success
 _  $response["success"] = 1;

 _  // echoing JSON response
 _  echo json_encode($response);
} else {
_   // no_products found
_   $response["success"] =_0;
  _ $response["message"]_= "No topics_found";

    // echo_no users JSON
_   echo json_encode($response);
}
?>

this is_the_string I got_from_server_
03-17 16:04:21.599:_E/JSON(502): <!DOCTYPE html_PUBLIC_"-//W3C//DTD XHTML_1.0_Strict//EN"
03-17 16:04:21.599: E/JSON(502):   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
03-17_16:04:21.599:_E/JSON(502): <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
03-17 16:04:21.599: E/JSON(502):_<head>
03-17 16:04:21.599: E/JSON(502): <title>Object_not_found!</title>
03-17 16:04:21.599: E/JSON(502): <link_rev="made" href="mailto:postmaster@localhost" />
03-17 16:04:21.599: E/JSON(502):_<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
03-17