bonjour à tous,

voila mon probleme, je souhaite stocké mes resultats dans une table autre que celle des proposition. le probleme, rien ne s'affiche à l'ecran

mes tables sql:
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
 
CREATE TABLE `tt_sondage` (
  `id` smallint(6) NOT NULL auto_increment,
  `id_lang` char(50) NOT NULL
`question` text NOT NULL,
  `proposition1` varchar(100) NOT NULL,
  `proposition2` varchar(100) NOT NULL,
  `proposition3` varchar(100) NOT NULL,
  `proposition4` varchar(100) NOT NULL,
  `proposition5` varchar(100) NOT NULL,
 
  PRIMARY KEY  (`id`)
)
 
CREATE TABLE `resultats` (
 
  `resultats1` smallint(6) NOT NULL,
  `resultats2` smallint(6) NOT NULL,
  `resultats3` smallint(6) NOT NULL,
  `resultats4` smallint(6) NOT NULL,
  `resultats5` smallint(6) NOT NULL,
 
)
et le script:
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
<?php
if(isset($_GET['sondage'])){
    $page = $_GET['sondage'];}
    if(!$_GET['sondage'] == 'archive') {
 
// récupération des rubriques
require('configuration.php');
 
$nombreEntrees = mysql_query("SELECT MAX(id) AS nbre_entrees FROM tt_sondage  ") or die(mysql_error());
$numeroDusondage = mysql_fetch_assoc($nombreEntrees);
 
//On sélectionne la question et les choix
 
$req="SELECT question, proposition1, proposition2, proposition3, proposition4, proposition5 FROM tt_sondage WHERE id = '" . $numeroDusondage['nbre_entrees'] . "' ";
$MySQL_infos = mysql_query($req) or die(mysql_error());
$infos = mysql_fetch_array($MySQL_infos);
//On sélectionne le nombre de votes
$MySQL_votes = mysql_query("SELECT resultats1, resultats2, resultats3,resultats4,resultats5 FROM resultats r, tt_sondage t WHERE t.id = '" . $numeroDusondage['nbre_entrees'] . "'") or die(mysql_error());
$votes = mysql_fetch_assoc($MySQL_votes);
//script pour ajouter les votes et ip
$ip = $_SERVER['REMOTE_ADDR'];
$prop = "prop";
$resultat = "resultats";
$fin = false;
if(isset($_POST['sondage']))
{
	for($i = 1; $i <= 5 && !$fin; $i++)
	{
		if($_POST['sondage'] == $prop . $i)
		{
			$votes[$resultat . $i] ++;
			mysql_query("UPDATE resultats SET  " . $resultat . $i ." = '" . $votes[$resultat . $i] . "' WHERE id = '" . $numeroDusondage['nbre_entrees'] . "'") or die(mysql_error());
			$fin = true;
		}
	}
	// Redirection sur cette meme page pour eviter le re-POST
	header('Location: http://testfcs.dungeon-party.com/testvincent/');
	ob_start();
	ob_flush();
}
 
// On recupere les nombre total de votes resultat
$query = "SELECT  resultats1,resultats2,resultats3,resultats4, resultats5 FROM resultats r, tt_sondage t WHERE t.id="."'" . $numeroDusondage['nbre_entrees'] . "'";
$row = mysql_query($query);
$data = mysql_fetch_array($row);
$resultat1 = $data["resultats1"];
$resultat2 = $data["resultats2"];
$resultat3 = $data["resultats3"];
$resultat4 = $data["resultats4"];
$resultat5 = $data["resultats5"];
 
$total_votes =  $resultat1 + $resultat2 + $resultat3 + $resultat4 + $resultat5;
if($total_votes != 0){
    $pourcentage_r1 = ($resultat1 / $total_votes) * 100;
    $pourcentage_r2 = ($resultat2 / $total_votes) * 100;
    $pourcentage_r3 = ($resultat3 / $total_votes) * 100;
    $pourcentage_r4 = ($resultat4 / $total_votes) * 100;
    $pourcentage_r5 = ($resultat5 / $total_votes) * 100;
}
else{
    $pourcentage_r1 = 0;
    $pourcentage_r2 = 0;
    $pourcentage_r3 = 0;
	$pourcentage_r4 = 0;
	$pourcentage_r5 = 0;
}
$long_max_bloc = 120;
//recupere ip et on insere par rapport à l'id
if(isset($_POST['sondage'])){
    $vote_ip = $_SERVER['REMOTE_ADDR'];
    $sondage_id = $numeroDusondage['nbre_entrees'];
    $sql = "INSERT INTO $table1 (sondage_id, vote_ip) VALUES ($sondage_id, '$vote_ip')";
    mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
 
}
$vote_ip = $_SERVER['REMOTE_ADDR'];
$query = "SELECT vote_ip FROM $table1 WHERE vote_ip='$vote_ip' and  sondage_id="."'" . $numeroDusondage['nbre_entrees'] . "'  " ;
$result = mysql_query($query);
$num = mysql_num_rows($result);
 
 
echo '<br />';
 
echo '<form method="post" name="sondage" >';
 
$sql = "SELECT resultats1,resultats2,resultats3,resultats4, resultats5 FROM resultats r, tt_sondage t WHERE id="."'" . $numeroDusondage['nbre_entrees'] . "' ";
//exécution de notre requête SQL:
$requete = mysql_query( $sql) or die( "ERREUR MYSQL numéro: ".mysql_errno()."<br>Type de cette erreur: ".mysql_error()."<br>\n" );
merci par avance de votre aide