Salut,
Je veux savoir si ce code est juste :
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
 
mysql_connect("localhost", "root", ""); // Connexion à MySQL
mysql_select_db("alu"); // Sélection de la base 
 
$reponse = mysql_query("SELECT p.nom_projet as nom_projet,d.id_demande as num_demande ,d.borderaux_client as borderaux, COUNT(dp2.num_serie) as nb_cinqjour ,COUNT(dp3.num_serie) as nb_quinzejour,COUNT(dp4.num_serie) as nb_trentejour FROM demande d
LEFT JOIN demande_projet dpp on d.id_demande=dpp.id_demande
LEFT JOIN projet p on d.id_demande=dpp.id_demande AND dpp.id_projet=p.id_projet
LEFT JOIN demande_produit dp2 on d.id_demande=dp2.id_demande AND DATEDIFF(CURDATE(),ADDDATE(dp2.date_entree, INTERVAL '70' DAY))>0 
LEFT JOIN demande_produit dp3 on d.id_demande=dp3.id_demande AND DATEDIFF(CURDATE(),ADDDATE(dp3.date_entree, INTERVAL '60' DAY))>0
LEFT JOIN demande_produit dp4 on d.id_demande=dp4.id_demande AND DATEDIFF(CURDATE(),ADDDATE(dp4.date_entree, INTERVAL '45' DAY))>0
GROUP BY d.id_demande")or die( mysql_error() );
 
 
 
echo "<table width=\"435\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  
    echo "<tr>
    <td height=\"22\">&nbsp;</td>
	<td valign=\"top\" bgcolor=\"#6699FF\"><b>Nom projet</b>&nbsp;</td>
    <td>&nbsp;</td>
	<td valign=\"top\" bgcolor=\"#6699FF\"><b>Num&eacute;ro demande</b>&nbsp;</td>
    <td>&nbsp;</td>
	<td valign=\"top\" bgcolor=\"#6699FF\"><b>Borderaux client</b>&nbsp;</td>
    <td>&nbsp;</td>
    <td valign=\"top\" bgcolor=\"#6699FF\"><b>Produits avec &eacute;ch&eacute;ance 5j</b>&nbsp;</td>
    <td>&nbsp;</td>
	<td valign=\"top\" bgcolor=\"#6699FF\"><b>Produits avec &eacute;ch&eacute;ance 15j</b>&nbsp;</td>
    <td>&nbsp;</td>
	<td valign=\"top\" bgcolor=\"#6699FF\"><b>Produits avec &eacute;ch&eacute;ance 30j</b>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>";
 
while ($donnees = mysql_fetch_array($reponse) )
{
 
 
 
echo '<td height="22">&nbsp;</td>
 <td valign="top">'.$donnees['nom_projet'].'&nbsp;</td>
    <td>&nbsp;</td>
    <td valign="top">'.$donnees['num_demande'].'&nbsp;</td>
    <td>&nbsp;</td>
    <td valign="top">'.$donnees['borderaux'].'&nbsp;</td>
    <td>&nbsp;</td>
    <td valign="top">'.$donnees['nb_cinqjour'].'&nbsp;</td>
    <td>&nbsp;</td>
	<td valign="top">'.$donnees['nb_quinzejour'].'&nbsp;</td>
    <td>&nbsp;</td>
    <td valign="top">'.$donnees['nb_trentejour'].'&nbsp;</td>
    <td>&nbsp;</td>
   
  </tr>';
 
 
}
 echo "</table>";
mysql_close(); // Déconnexion de MySQL
 ?>
Car les colonnes produits avec echeance 5j ,15j et 30j me retourne 0