Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to recieve data from database back into android
    primarykey
    data
    text
    <p>I have created a webservice called "login.php" where I send the id and password information from android. The webservice successfully catches the id and password. I need to compare that id and password to the ones already present in the database and check whether they exist or not. If they do, I need to send back an "okay message" back to android so I can start a new intent. If the id and password do not exist, I want to display an error. Below is my code.</p> <p>Login.java</p> <pre><code>HttpPost httppost = new HttpPost("http://abc.com/webservice/Login.php"); try { List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); nameValuePairs.add(new BasicNameValuePair("userid", et1.getText().toString())); nameValuePairs.add(new BasicNameValuePair("pass", et2.getText().toString())); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); client.execute(httppost); Log.d("valueeeeeeeeeeee", et6.getText().toString()); } catch (ClientProtocolException e) { // TODO Auto-generated catch block Log.d("exppppppp", "msg"); } catch (IOException e) { // TODO Auto-generated catch block Log.d("exppppppp", "msg"); } </code></pre> <p>Login.php:</p> <pre><code>&lt;?php $host = "localhost"; $user = "user"; $pass = "pass"; $connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."&lt;BR&gt;"); $userid = $_POST['userid']; $pass = $_POST['pass']; $db_select=mysql_select_db("my_db"); if(!$db_select){ die(mysql_error()); echo "error"; } </code></pre> <p>What query should I run here to check the database against the specific id and password it recieved and send back an "okay message" to the android app. Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload