Bonjour à tous !
J'ai fais une petite page qui permet d'afficher les historiques des clients, dans ma table des historiques j'ai des codes articles. J'aurais aimé afficher le libellé de ces articles et non pas les codes articles. Seul solution la jointure !
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
<?php
	//initialisation des variables
	$id_client = $_GET['id'];
	$nb_enregistrement = 0;
 
	echo'
		<h1>Historique</h1>
	';	
 
	//requète de recherche des historiques
	$rqt_histo = "SELECT Code_art, Date_Historique, Tarif, Qté, Cndt FROM Historique ORDER BY Date_Historique DESC";
	$exec_histo = mysql_query($rqt_histo) or die ('Erreur lors de la requète de recherche d\'historique : '.mysql_error());
    //requète de jointure	
 
 
 
	echo'<div style="height:350px;overflow:auto;"><table class="table_historique">
			<tr>
				<td>Identifiant Article</td><td>Date</td><td>Tarifs</td><td>Quantité</td><td>Conditionnement</td>
			</tr>
	';
	while($data_histo = mysql_fetch_array($exec_histo)){
		$nb_enregistrement ++;
		//requète de "jointure" entre historique et article
		$rqt_joint = 'SELECT ID_Article, Lib_Article, Code_Art FROM Article, CNDT WHERE ID_Article = "'.$data_histo[0].'"';
        $exec_joint = mysql_query($rqt_joint) or die ('Erreur lors de la requête de jointure : '.mysql_error());
		$data_joint = mysql_fetch_array($exec_joint);
        $nom_art = $data_joint[1];
		if($nb_enregistrement%2 == 0){
			echo'	
				<tr class="pair">
					<td>'.$nom_art.'</td><td>'.$data_histo[1].'</td><td>'.$data_histo[2].'</td><td>'.$data_histo[3].'</td><td>'.$data_histo[4].'</td>
				</tr>
			';
		}
		else{
			echo'	
				<tr>
					<td>'.$nom_art.'</td><td>'.$data_histo[1].'</td><td>'.$data_histo[2].'</td><td>'.$data_histo[3].'</td><td>'.$data_histo[4].'</td>
				</tr>
			';
		}
	}
	echo'</table></div>
		<br />
		<a href="index.php?page=details_client&id='.$id_client.'"><input type="submit" value="Retour"></a>

	';
?>
Seul problème c'est qu'il m'affiche une erreur je cite :
Citation Envoyé par WampServer
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\xxx\include\page\historique.php on line 26
Je ne sais plus où chercher :/

Cordialement
Awery