fichier .js
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var redips = {};
redips.init = function () {
     redips.request = redips.initXMLHttpClient();
     redips.InitTable();
}
 
redips.hide_tables = function () {
 
  /* init each table */
  var xhr = getXMLHttpRequest();
  for (var $Table_Id=0; $Table_Id < 4; $Table_Id++) 
  {
      for (var $Player_Id=0; $Player_Id < 19; $Player_Id++) 
      {
          $getJSON
          (
	"get-content.php",
	{Table_Id:$Table_Id, Player_Id :$Player_Id},
	function (data)
	{
	    console.log(data.nom);
	    console.log(data.penom);
                  /* in the future add name in class 'player'*/
                  /* 'colum'  according to id _player*/
	}
             );
      };
   };
};

fichier .php
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
 
$Tab_Id = $_GET["Tab_Id"];
$Player_Id = $_GET["Player_Id"];
 
/*E = injured player*/
$team = array (
	0 => "A",
	1 => "B",
	2 => "C",
	3 => "D", 
	4 => "E",
);
 
$Tab_Id = $team [$Tab_Id];
 
$db = mysql_connect('localhost', 'root', '');
mysql_select_db('esd',$db);
function AlphabeticSearch($letter)
{
	$query = ("SELECT nom, penom FROM joueur Where joueur.nom LIKE '{$letter}%' ");
	$result = mysql_query($query);
	while($row = mysql_fetch_array($result))
	{
	  echo $row['nom']." - ".$row['penom']."<br>";
	}				    
};
 
function SearchNameBDD ($Tab_Id, $Player_Id)
{
	$query = ("SELECT nom, penom FROM joueur Where joueur.id LIKE '{$Player_Id}%' AND joueur.equipe LIKE '{$Tab_Id}%'");
	$result = mysql_query($query);
	while($init = mysql_fetch_array($result))
	{
	  $init['nom'];
	  $init['penom'];
	}	
 
	header('Content-type: application/json');
}
 
mysql_close();
?>

fichier html
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
<table class='joueur'>
   <tr>
      <tr>
         <td class='colum'>1</td>
         <td class='player'></td>
      </tr>
       <tr>
          <td class='colum'>2</td>
          <td class='player'></td>
      </tr>
   </tr>
</table>

Bonjour,
J'ai testé cette exemple mais ma page mets trop de temps à s'afficher. Et j'ai quelques doutes sur la fonction header et getJSON