Php returning success to java after data found in database and on insert of database -


<?php  include("db_config.php");  $myusername = $_get['username']; $mypassword = $_get['password'];    $sql="select id tablename username='$myusername' , password='$mypassword'";  echo $sql;  $result=mysql_query($sql); $row=mysql_fetch_array($result); $active=$row['active'];  $count=mysql_num_rows($result);    // if result matched $myusername , $mypassword, table row must 1 row if($count==1) {  echo "<strong> <font size='18'>login success</font></strong>";  }  else   { echo "<strong> <font size='18'>login failed</font></strong>"; }  ?> 

i tried response array on success.. in java file wen receive .. showing null.. using line receive success

  success=json.getint(tag_success); 

also used in json parser class check if server returns success.

  if (response.getstatusline().getstatuscode() == 200)  

and login giving login failed.. though enter username present in database

can any1 me??

not sure library using using method "getint()" on html text "login success/failed" looks wrong.

using "json." method on html data looks wrong.

so php emit valid json, and, java extract login success or failed text hte json.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -