Bonsoir,
SVP je suis en train de construire une application android mais je mes suis plentée au niveau de l'authentification.
L'utilisateur doit enter son login et password et j'ai fait des requetes sql dans le fichier php pour vérifier les données saisies et ensuite je récupére le CIN qui est dans la meme table "authentification" pour faire des requetes dans une autre tablau en utilisant ce CIN qui est clé primaire dans la derniére table.
J'obtiens cette exception au dessus !
j'en comprends pas pourquoi sachant que dans le navigateur j'ai eu le bon résultat.
voila une partie de mon code ou se fait l'exception
[
private class SigninActivity extends AsyncTask<String, Void, String> {


@Override
protected String doInBackground(String... arg0) {
String newString="";

try {

String tonTexte = loginDisplay.getText().toString();
String tonTexte1 = passDisplay.getText().toString();

String link = "http://192.168.56.1/projects/stage/atelier.php";
String data = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode(tonTexte, "UTF-8");
data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode(tonTexte1, "UTF-8");



URL url = new URL(link);
URLConnection conn = url.openConnection();

conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();


BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(),"UTF-8"),8);

StringBuilder sb = new StringBuilder();
String line = null;

// Read Server Response
while ((line = reader.readLine()) != null) {
sb.append(line);
break;
}
return sb.substring(sb.indexOf("["),sb.lastIndexOf("]") + 1);
} catch (Exception e) {
return new String("Exception: " + e.getMessage());
}
}

@Override
protected void onPreExecute() {
super.onPreExecute();



}


@Override
protected void onPostExecute(String result) {
TextView a = (TextView) findViewById(R.id.aff);
JSONObject json_data=null;
TextView b = (TextView) findViewById(R.id.aff1);


//recuperation des donnees json
try{
JSONArray jArray = new JSONArray(result);

for(int i=0;i<jArray.length();i++)
{

json_data = jArray.getJSONObject(i);
Log.i("log_tag","cin: "+json_data.getString("nom"));
donnees.add(json_data.getString("nom"));
donnees1.add(json_data.getString("atelier"));

}
for(String elem: donnees)
{
a.setText(elem);
}
for(String elem: donnees1)
{
b.setText(elem);
}

}
catch(JSONException e){
Log.i("tagjsonexp",""+e.toString());
} catch (ParseException e) {
Log.i("tagjsonpars", "" + e.toString());
}

}



}
]


et voila le code php
<?php
$base = mysql_connect ('localhost', 'root', '');
mysql_select_db ('stage', $base) ;
$output=array();
$username = $_POST['username'];
$password = $_POST['password'];
$sql=mysql_query("SELECT CIN FROM authentification where login= '".$username."' AND password = '".$password. "'");
if (!$sql) {
die(mysql_error());
}
while($data = mysql_fetch_array($sql))
{
$a=$data['CIN'];
}
$sql1=mysql_query("SELECT nom,atelier FROM controlleur where CIN= '".$a."'");
while($row=mysql_fetch_assoc($sql1))
{
$output[]=$row;
}
print(json_encode(array("NomTableau" => $output)));
mysql_close();
?>

Merci bcp pour toute aide