Bon voila j’ai un trombinoscop
et les gens peuvent voté sur les différentes personnes.
Le problemes est que ça marche pas et je piges pas pk, j’ai des valeurs fause alors que dans le calcul elle sont juste
[cpp]<?php require_once('../../Connections/trombinoV3.php'); ?>
<?php mysql_select_db($database_trombinoV3, $trombinoV3); $query_trombino = "SELECT * FROM trombino"; $trombino = mysql_query($query_trombino, $trombinoV3) or die(mysql_error()); $row_trombino = mysql_fetch_assoc($trombino); $totalRows_trombino = mysql_num_rows($trombino); $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["Note_update"])) && ($_POST["Note_update"] == "note")) { /* $query_note = "SELECT `note`, `hits` FROM `trombino` WHERE idx = ".$_POST['idx'].""; $note = mysql_query($query_note, $trombinoV3) or die(mysql_error()); $row_note = mysql_fetch_assoc($note); $totalRows_note = mysql_num_rows($note); */ $q1 = mysql_query("SELECT `note`, `hits` FROM `trombino` WHERE idx = 7"); $r1 = mysql_fetch_array($q1); $note = ( $r1['note'] + $_POST['choix'] ) / ( $r1['hits'] +1 ); echo $note; echo'= ('; echo $r1['note']; echo'+'; echo $_POST['choix']; echo' ) /'; echo $r1['hits']; echo' +1' ; $updateSQL = sprintf("UPDATE trombino SET note=note+%s, hits=hits+1 WHERE idx=%s", $note, $_POST['idx']); mysql_select_db($database_trombinoV3, $trombinoV3); $Result1 = mysql_query($updateSQL, $trombinoV3) or die(mysql_error()); $updateGoTo = "Untitled-1.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } // header(sprintf("Location: %s", $updateGoTo)); echo ""; //*/ //} ?> <?php require_once('fonctions.php'); ?> Document sans titre<?php echo $row_trombino['note']; ?> |
<?php echo ''; ?> <?php echo ''.$row_trombino['hits'].' votant(s)'; ?><?php echo $row_trombino['note']; ?> - <?php echo $row_trombino['img_pourcent'] ?> |
<?php echo $row_trombino['hits']; ?> | |
<?php echo $row_trombino['img_pourcent']; ?> | |
| |
| |
| |
<?php echo ""; $q2 = mysql_query("SELECT *, DATE_FORMAT(date, '$site_date_jh') AS dateh FROM commentaires WHERE refer = ".$row_trombino['idx']." ORDER BY date"); $n2 = mysql_num_rows($q2); echo "Il y a actuellement [b]$n2[/b] commentaire"; while ($r2 = mysql_fetch_array($q2)) echo "[/url]"; ?> | '> 20 30 40 50 60 70 80 90 100 |