Bonjour, j'ai une page qui fonctionne tres bien en local, mais lorsque j'ai voulu la mettre en ligne le tableau ne s'affiche pas. Il y a simplement le formulaire qui s'affiche.
Voici mon code qui me permet d'afficher mon tableau
Je pense avoir fais le tour du code mais je ne comprend pas pourquoi ca ne fonctionne pas
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
60 <?php // Fonction pour construire une table à partir des résultat de la requête function buildClodoTable($where='') { // Construire la requete $query = "SELECT clodo,att,def,fightvalue,habilite,attaque,defense,maj, date_format(maj,'%Y-%m-%d') lastmaj FROM membre ORDER BY fightvalue DESC"; // Executer la requete $result = mysql_query($query) or die('Erreur SQL !<br>'.$result.mysql_error()); if ($result==false) { // on p'tit message d'erreur sympa indiquant que ça a merdé pourrait être appréciable (plutôt qu'une page blanche) <img src="./images/smilies/icon_smile.gif" alt=":)" title="Smile" /> echo mysql_error(); } $lines = ''; $now = new DateTime(date('Y-m-d')); while ($row = mysql_fetch_array($result)) { $lastmaj = new DateTime($row['lastmaj']); $interval = $lastmaj->diff($now); if( $interval->format('%d') >= 7)$style = 'background-color:red'; else $style = ''; $lines .= ' <tr style="'.$style.'"> <td>'.$row['clodo'].'</td> <td>'.$row['att'].'</td> <td>'.$row['def'].'</td> <td>'.$row['fightvalue'].'</td> <td>'.$row['habilite'].'</td> <td>'.$row['attaque'].'</td> <td>'.$row['defense'].'</td> <td>'.$row['maj'].'</td> </tr>'; } return ' <table border="1" cellpadding=5 cellspacing=5 height=50> <tr> <th class="name"> Nom clodo </th> <th> ATT </th> <th> DEF </th> <th> Fightvalue </th> <th> habilité </th> <th> attaque </th> <th> défense </th> <th> MAJ </th> </tr>'.$lines.' </table>'; } //Construire le tableau à partir du résultat de la requête $table = buildClodoTable(""); echo $table; } ?>
Partager