Communication avec mysql depuis Android via un service php

Résolu
imenandroid Messages postés 12 Date d'inscription vendredi 14 février 2014 Statut Membre Dernière intervention 25 février 2014 - Modifié par cs_Julien39 le 24/02/2014 à 08:06
imenandroid Messages postés 12 Date d'inscription vendredi 14 février 2014 Statut Membre Dernière intervention 25 février 2014 - 24 févr. 2014 à 22:24
Bonjour,

j'ai essayé de suivre ce tuto : http://codes-sources.commentcamarche.net/faq/10789-connecter-une-application-android-a-une-base-de-donnees

voici l'appel du script php :

httppost= new HttpPost("http://10.0.2.2/streaming/check.php");

sachant que j'ai crée une base de donéee qui conteient une table tbl_user avec deux colones username et password et j'ai implémenter comme page php


<?php
$hostname_localhost ="localhost";
$database_localhost =" mysqldatabase";
$username_localhost ="root";
$password_localhost ="";
$localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost)
or
trigger_error(mysql_error(),E_USER_ERROR);

mysql_select_db($database_localhost, $localhost);


$query_search = 'INSERT INTO tbl_user(username,password) VALUES("'.$_GET['usernamee'].'", "'.$_GET['password'].'")';
$query_exec = mysql_query($query_search) or die(mysql_error());
$rows = mysql_num_rows($query_exec);



//echo $rows;
if($rows == 0) {
echo "No Such User Found";
}
else {
echo "User Found";
}
?>
lorsque j'execute mon application android tjrs il m'affiche juste au dessous du bouton login ce message :

Reponse from PHP:<br/> 
<b> Notice</b>:Undefined index:username in<b>C:\Documents and Settings\Administrateur\Bureau\streaming\check.php</b>
on line <b>13</b></br>
<br/>
<b> Notice</b>:Undefined index:password in<b>C:\Documents and Settings\Administrateur\Bureau\streaming\check.php</b>
on line <b>13</b></br>
No database selected

3 réponses

cs_Julien39 Messages postés 6414 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 29 juillet 2020 371
24 févr. 2014 à 07:58
Bonjour,

Je viens de modifier ton message pour qu'il soit compréhensible, c'est la dernière fois que je le fais. La prochaine fois, je ferme le sujet.
0
Rejoignez-nous