salut tous le monde j'ai fais ce code pour la replie des trois tableau que je j'aurai besoin par les valeurs prevenantes de ma base de données tronsport mais il ya une erreur car rien ne se chargent .
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
<html>
<head>
<title>CONVPHPJS</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script LANGUAGE="Javascript" type="text/javascript">
    function Affiche(Index) {
        alert(Tab_js[Index] + " - " + Tab_js2[Index]);
    }
</script>
<body>
<? 
   /************** Connection ****************/  
 
 $host="localhost";                                                 
 $nom="root";
 $pass="";
 $link=mysql_connect($host,$nom,$pass) or die ("Connexion impossible");   
 mysql_select_db("tronsport",$link);
 
   /************** Fonction pour la convérsion du tableau de PHP au Javascript ****************/
 
 function TabPHP_to_JS($tableauPHP, $tableauJS) {
    echo $tableauJS . " = new Array();";
    for($i = 0; $i < count($tableauPHP); $i++) {
        if (!is_array($tableauPHP[$i])) {
            echo $tableauJS . "[" . $i . "] = '" . $tableauPHP[$i] . "';";
        }
        else {
            TabPHP_to_JS($tableauPHP[$i], $tableauJS . "[" . $i . "]");
        }
    }
    return;
 }
    $Tab_php = array(100);
    $Tab_php2 = array(100);
    $Tab_php3 = array(100);
    $i = 0;
 
    $selec = mysql_query("select * FROM autocar,billet_voyageur,voyage");
 
    while ($datamenu = mysql_fetch_array($selec)) {
        $Tab_php[$i] = $datamenu["voyage.VoyageId"];
        $Tab_php2[$i] = $datamenu["autocar.AutocarId"];
        $Tab_php3[$i] = $datamenu["Billet_voyageur.VoyageurId"];
 
        echo "<a href=\"#\" onClick=\"Affiche(" . $i . ");\">" . $datamenu["voyage.VoyageId"] . "</a><br>";
        $i++;
    }
    echo "<script type='text/javascript'>";
        TabPHP_to_JS($Tab_php, "Tab_js");
        TabPHP_to_JS($Tab_php2, "Tab_js2");
  TabPHP_to_JS($Tab_php3, "Tab_js3");
    //echo "document.write(monTableauJS.toSource());";
    echo "</script> ";
?>
</body>
</html>
merci de m'avoir aider.