Je suis en train de travailler sur un projet de service web en php. je veux récupérer tous les données d'un client déja enregistrés dans la base de donnée sous forme de form mais les champs récupérés sont vide.
le code de methode dans le serveur:
function lister($Identifient){
$db8=new PDO('mysql:host=localhost;dbname=db_ramacaisse','root','');
$db8->query('SET NAMES UTF8');
$req=$db8->query('select * from client_restaurant where Identifient ="'.$Identifient.'"');
while($row=$req->fetchAll(PDO::FETCH_ASSOC)){
return $row['Nom']; */
return array('codebarre'=>$row['CodeBarre'],'codepostal'=>$row['CodePostal']);
}
}
l'appel client:
session_start();
error_reporting(E_ALL ^ E_NOTICE);
// Pull in the NuSOAP code
require_once('lib/nusoap.php');
// Create the client instance
$client = new nusoap_client('http://localhost/work/server.php');
$result=$client->call('lister',array('Identifient'=>$_GET['id']));
//print_r($result);
// $count = count($result);
echo '<form method="post">';
echo '<table>';
echo '<tr><td>codebarre</td><td><input type="text" name="code" value="'.$result['codebarre'].'"></td></tr>';
echo '<tr><td>Code Postale</td><td><input type="text" name="cp" value="'.$result['codepostal'].'"></td></tr>';
echo '</table';
echo '</form>';
Merci