Dear Flexer, 

I'm a french user, and I have some problem with charset.

Indeed, I try to use httpservice to load data in datagrid.

To do that, I use the php file, you can read below.

<?php
include 'functions.php';
require_once 'MySQL.php';
require_once 'conf.php';

header("Content-Type: text/xml; charset=ISO-8859-1"); 


$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PWD, DB_DATABASE);
if (mysqli_connect_errno()) {
    printf("Échec de la connexion : %s\n", mysqli_connect_error());
    exit();
}

// If a connection was established, run the query:
if ($dbc) { 
        // Define the query:
        $q ='SELECT 14TypeRdv.trIndex, 14TypeRdv.trCode, 14TypeRdv.trNom, 
14TypeRdv.trDurDef, 14TypeRdv.trDurPrat, 14TypeRdv.trCouleur FROM 14TypeRdv';
        }
        
// Run the query:
        $r = mysqli_query($dbc, $q);
        
                $reponse = "<typeRDVs>";
                

        // Confirm that some rows were returned:
        if (mysqli_num_rows($r) > 0) {
                // Fetch every row and print it as XML:
                while ($row = mysqli_fetch_array($r, MYSQLI_NUM)) {
 $reponse.="<typeRDV><id>".$row[0]."</id>";
 $reponse.="<code>".$row[1]."</code>";
 $reponse.="<nom>".$row[2]."</nom>";
 $reponse.="<duree>".$row[3]."</duree>";
 $reponse.="<tps>".$row[4]."</tps>";
$reponse.="<color>".$row[5]."</color>";

  $reponse.="</typeRDV>";
 
                        } 
        } 
        
        else
        {
        $reponse.="<typeRDV></typeRDV>";

        }
                        $reponse.="</typeRDVs>";
                        
echo $reponse;

?>



But when I test it in my brower the message xml file worth formatted appear.
In flex, an error appear.

Can you help me to solve that.

Thanks

Reply via email to