Bonjour à tous!
J'ai suivi le tuto concernant json il y a un bon bout de temps.
Mon code fonctionnait, et là, il ne fonctionne plus depuis que j'ai mis wamp à jours (retour null), et sur le serveur il ne charge plus les dernières infos, mais celles d'il y a quelques jours oui.
Bizarre.
Est-ce que quelqu'un peut m'éclairer svp.
Merci.
Je met mon code.
inter_validation.php qui est en include dans la page index
<div id='inter_a_valider' class='bloc_menu'>
<h1>Interventions a valider<span id="chargement_demande" style="display:none;"><img src="images/loader/roller.gif"></span></h1>
<table id='tab_inter_a_valider'>
</table>
</div>
<script type='text/javascript'>
$(function(){
function RecupDemande(){
$("#chargement_demande").show();
$.post('module/intervention/inter_validation_traitement.php',{"service":<?php echo $_SESSION'service']; ?>},
function(data){
$('#tab_inter_a_valider').html(data.retour);
setTimeout( RecupDemande,10000);
}
,'json');
$("#chargement_demande").hide(); }
RecupDemande();
});
</script>
et la page inter_validation_traitement.php
<?php
include "../../fonctions.php";
include "../../connexion.php";
echo connexion();
//$service=$_POST'service'];
$service=1;
if(mysql_result(mysql_query("select count(id) from inter_saisie where etat=0") ,0)!=0){
$sql_req="SELECT inter_saisie.id,suivi_mail,localisation,intitule_local,probleme,datecreation,service_inter
FROM inter_saisie
INNER JOIN _localisation
ON id_local = inter_saisie.localisation
WHERE inter_saisie.etat=0
AND service_inter=".$service."
ORDER BY inter_saisie.id";
$sql_exe=mysql_query($sql_req) or die(mysql_error());
$tab = array();
$tab'retour']='';
while ($sql_bdd=mysql_fetch_assoc($sql_exe))
{
$idhach=sha1($sql_bdd'id']);
$prob_retouch=epurage(substr($sql_bdd'probleme'],0,150));
$tab'retour'] .= '<tr><td><a href="index.php?page=newinter&id='.$idhach.'" class="titre_demande_inter">
<strong>'.AffichDate('d/m/Y H:i', $sql_bdd'datecreation']).' - ('.RecupLocalisation($sql_bdd"localisation"],0).') <span class="accentuation"> - '.$sql_bdd'suivi_mail'].'</span></strong>
<div class="prob_demande_inter">'.$prob_retouch.' ..]</div></a>
</td></tr>';
}
}
else{
$tab'retour'] = '<tr><td class="accentuation">Pas d\'interventions à valider</td></tr>';
}
echo json_encode($tab);
?>