Probleme avec tableau de vote

Invité
Invité n'ayant pas de compte PHPfrance

27 févr. 2008, 20:26

Voila j'ai mon pote qui a un probleme avec un tableau de vote en faite dans les scores les nombres 10 se trouve en derniere position regarde c'est ici .

http://www.club6tem.net/top50.php

ViPHP
ViPHP | 5924 Messages

27 févr. 2008, 20:36

Une colonne en varchar alors qu'elle devrait être en int…

Invité
Invité n'ayant pas de compte PHPfrance

27 févr. 2008, 20:39

ok vais lui dire merci de la reponse

Invité
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 09:36

Bon il me dit que c'est pas sa . Il a deja essayer .

Avatar du membre
Administrateur PHPfrance
Administrateur PHPfrance | 13231 Messages

28 févr. 2008, 12:04

Comment est-ce qu'il tri les résultats ? en SQL ? en PHP ?
Connaître son ignorance est la meilleure part de la connaissance
Pour un code lisible : n'hésitez pas à sauter des lignes et indenter

twitter - site perso - Github - Zend Certified Engineer

Invité
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 13:08

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="verify-v1" content="+riQSKcP5Y6UWLBPpGfuvoRpURZbVAfAoJKobDTg4bY=" />
<Meta http-equiv="Pragma" content="no-cache">

<!-- Debut Meta-Tags aLaide.com (http://www.alaide.com/) //-->
<META Http-Equiv="Content-Type" Content="text/html; charset=ISO-8859-1">
<META Http-Equiv="Content-Language" Content="fr">
<META Name="Title" Lang="fr" Content="Club6Tem.NeT">
<META Name="Description" Lang="fr" Content="Webradio francophone dedié a la musique electronique . Le Jump la dance ainsi que la techno sont mis en premier plan  ...">
<META Name="Keywords" Lang="fr" Content="club6tem ,son ,musique ,tehno ,dance ,jump ,otraxx ,dedicace ,tchat ,irc ,housse ,winamp , mediaplayer , realplayer ,webplayer">
<META Name="Language" Content="fr">
<META Name="Reply-To" Content="[email protected]²">
<META Name="Category" Content="Internet">
<META Name="Robots" Content="index, follow">
<META Name="Distribution" Content="global">
<META Name="Revisit-After" Content="7 days">
<META Name="Author" Lang="fr" Content="NeO_DeStrucToR">
<META Name="Publisher" Content="NeO_DeStrucToR">
<META Name="Copyright" Content="Club6tem.NeT © Tous droit résérvé .">
<META Name="Generator" Content="Namo WebEditor v5.0">
<META Name="Identifier-URL" Content="http://www.club6tem.net">
<META Name="Expires" Content="never">
<META Name="Date-Creation-yyyymmdd" Content="20070901">
<META Name="Date-Revision-yyyymmdd" Content="20070913">
<!-- Fin Meta-Tags aLaide.com (http://www.alaide.com/) //-->
<title>¤¤ Club6Tem.NeT Non Stop Club Sound ¤¤</title>
<link href="styles2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-image: url(design/fond.jpg);
	background-color: #0063be;
	background-repeat: repeat-y;
}
.Style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
	font-weight: bold;
}
-->
</style>
<meta name="generator" content="Namo WebEditor v5.0">
</head>

<body>
<table width="923" align="center" height="368" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td background="design/header.jpg"><embed src="design/header.swf" width="923" height="368" wmode="transparent"></td>
  </tr>
</table>
<table width="923" align="center" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="15" background="design/border-gauche.gif">&nbsp;</td>
    <td valign="top" width="758" background="design/fond-table.jpg"><table width="748" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="435"><table border="0" cellpadding="0" cellspacing="0" width="430" align="left">
<!-- fwtable fwsrc="Sans titre" fwbase="titre.jpg" fwstyle="Dreamweaver" fwdocid = "68913176" fwnested="0" -->
  <tr>
   <td><img src="design/spacer.gif" width="7" height="1" border="0" alt="" /></td>
   <td><img src="design/spacer.gif" width="417" height="1" border="0" alt="" /></td>
   <td><img src="design/spacer.gif" width="6" height="1" border="0" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td colspan="3"><img name="titre_r1_c1" src="design/titre_r1_c1.jpg" width="430" height="62" border="0" id="titre_r1_c1" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="62" border="0" alt="" /></td>
  </tr>
  <tr>
   <td><img name="titre_r2_c1" src="design/titre_r2_c1.jpg" width="7" height="33" border="0" id="titre_r2_c1" alt="" /></td>
   <td><div align="center"><IFRAME name="ifrm1" 
        align="left" 
        marginWidth="0" 
        marginHeight="0" 
        src="stream.inc.php" 
        frameBorder="no" 
        noResize 
        width="400" 
        height="45">
</IFRAME></div></td>
   <td><img name="titre_r2_c3" src="design/titre_r2_c3.jpg" width="6" height="33" border="0" id="titre_r2_c3" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="33" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3"><img name="titre_r3_c1" src="design/titre_r3_c1.jpg" width="430" height="13" border="0" id="titre_r3_c1" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="13" border="0" alt="" /></td>
  </tr>
</table></td>
        <td width="5">&nbsp;</td>
        <td width="305"><table border="0" cellpadding="0" cellspacing="0" width="300" align="right">
  <tr>
   <td><img src="design/spacer.gif" width="59" height="1" border="0" alt="" /></td>
   <td><img src="design/spacer.gif" width="183" height="1" border="0" alt="" /></td>
   <td><img src="design/spacer.gif" width="58" height="1" border="0" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td colspan="3"><img name="nousecouter_r1_c1" src="design/nous-ecouter_r1_c1.jpg" width="300" height="60" border="0" id="nousecouter_r1_c1" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="60" border="0" alt="" /></td>
  </tr>
  <tr>
   <td><img name="nousecouter_r2_c1" src="design/nous-ecouter_r2_c1.jpg" width="59" height="41" border="0" id="nousecouter_r2_c1" alt="" /></td>
   <td><?php include('nou-ecouter.php'); ?></td>
   <td><img name="nousecouter_r2_c3" src="design/nous-ecouter_r2_c3.jpg" width="58" height="41" border="0" id="nousecouter_r2_c3" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="41" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="3"><img name="nousecouter_r3_c1" src="design/nous-ecouter_r3_c1.jpg" width="300" height="7" border="0" id="nousecouter_r3_c1" alt="" /></td>
   <td><img src="design/spacer.gif" width="1" height="7" border="0" alt="" /></td>
  </tr>
</table></td>
      </tr>
    </table>
      <table width="748" height="52" align="left" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="748"><img src="design/bloc01.jpg" width="748" height="52" />
          <table width="748" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="11" background="design/bloc02.jpg">&nbsp;</td>
              <td width="726">                                    <p align="center"><b><u>Top50</u></b></p>


<P align=center>
<?
include ("config.vote.php");
$connexion = mysql_connect($vote_mysql_serveur,$vote_mysql_pseudo,$vote_mysql_pass) or die ("Erreur lors de la connexion au serveur Mysql.");
mysql_select_db($vote_mysql_base,$connexion) or die ("Erreur lors de la sélection de la base de données.");

$requete = "SELECT id,titre,score FROM vote_club6tem ORDER BY score DESC limit 50";

$resultat = mysql_query($requete) or die ("Erreur lors de la sélection de la base de données.");

echo "<table border='1' bordercolor='#0163BE' bordercolordark='#0163BE' bordercolorlight='#0163BE' ALIGN='center'>";
echo "<FONT COLOR='black'><tr> <th>Place</th> <th>Titre</th> <th>Score</th></tr></font>";
while ($ligne = mysql_fetch_array($resultat) )
{
 $place = $place + 1;
 echo "<FONT COLOR='black'><tr><td ALIGN='center'>$place</td><td ALIGN='center'> $ligne[titre] </td><td ALIGN='center'> $ligne[score] </td></tr></font>";
}
echo "</table>";
?>
</td>
              <td width="11" background="design/bloc03.jpg">&nbsp;</td>
            </tr>
          </table>
          <table width="748" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td><img src="design/bloc04.jpg" width="748" height="21" /></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
    <td valign="top" width="150" background="design/border-droite.jpg"><embed src="design/menu.swf" width="150" height="258" wmode="transparent"></embed></td>
  </tr>
</table>
<table width="923" height="207" align="center" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><embed src="design/footer.swf" width="923" height="207" wmode="transparent"></embed></td>
  </tr>
</table>
</body>
</html>
voila se quil ma donner merci d'avance

Avatar du membre
Modérateur PHPfrance
Modérateur PHPfrance | 10684 Messages

28 févr. 2008, 13:15

C'est typiquement le problème indiqué par Sékiltoyai...

La clause "ORDER BY score DESC" tri les résultat du plus grand au plus petit. Donc si ton 10 est en dernier, c'est que soit les autres ont plus que 10, soit que le tri est fait de manière alphabétique et non numérique... on en revient au problème de colonne mal typée.

Demande lui la structure de sa table vote_club6tem (la requête "CREATE TABLE vote_club6tem ...")

Voire même, demande lui de venir nous la poster directement ;)
Ce n'est pas en améliorant la bougie que l'on a inventé l'ampoule...

Invité
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 13:32

-- phpMyAdmin SQL Dump
-- version 2.11.3deb1
-- http://www.phpmyadmin.net
--
-- Serveur: lover.sql.jexiste.fr
-- Généré le : Jeu 28 Février 2008 à 12:22
-- Version du serveur: 5.0.32
-- Version de PHP: 4.4.4-8+etch3

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Base de données: `lover`
--

-- --------------------------------------------------------

--
-- Structure de la table `vote_club6tem`
--

CREATE TABLE IF NOT EXISTS `vote_club6tem` (
  `id` int(5) NOT NULL auto_increment,
  `titre` varchar(255) default NULL,
  `score` mediumtext,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=106 ;

--
-- Contenu de la table `vote_club6tem`
--

INSERT INTO `vote_club6tem` (`id`, `titre`, `score`) VALUES
(1, 'Robbie Rivera - Float Away', '5'),
(2, 'John Dahlback - Blink (Hard Camp`s remix)', '1'),
(3, 'Clubraiders - Move your hands up (radio mix)', '3'),
(4, 'Club Piratez - The Rockafeller Woods', '2'),
(5, 'Question Mark - Storia (radio edit)', '-1'),
(6, 'paco osuna - freak (original mix)', '2'),
(7, 'dj boozywoozy - party affair', '5'),
(8, 'David Vendetta - Break 4 love', '1'),
(9, 'David Guetta - Distortion', '0'),
(10, 'dj jean - love comes home', '2'),
(11, 'Rachael Starr - Till There Was You (Original Club Mix)', '4'),
(12, '2 Girlz - Fallin Angel (Dj Uto Radio Remix Edit)', '3'),
(13, 'Enur Feat Natasja - Calabria 2007 (Extended)', '3'),
(14, 'Raf Enjoy - Discoteque', '2'),
(15, 'Paps `n` Skar - Vieni Con Me', '1'),
(16, 'hi tack - say say say (waitin 4 u)', '1'),
(17, 'VDK - Drop That Beat (Club Mix)', '-1'),
(18, 'Sander Kleinenberg - This is not Miami', '1'),
(19, 'wordenz - game star', '2'),
(20, '102 klaps - bedroom', '1'),
(21, 'NiCkOoS @ Club6Tem @ Live', '0'),
(22, 'Toto - Africa (Eric Prydz Bootleg Remix)', '1'),
(23, 'Jump Killer - save the jump', '2'),
(24, 'Loic.D Aka Mr.D - D-Tonation', '2'),
(25, 'booty luv - boogy 2nite', '-1'),
(26, 'John Dahlback - Blink', '1'),
(27, 'queen vs the miami project - another one bites the dust (soul avengerz remix)', '1'),
(28, '', '-1'),
(29, 'starstylers - keep on moving', '-1'),
(30, 'Dusty Kid vs Frederico Franchi', '1'),
(31, 'Donna Summers - On the Radio', '2'),
(32, 'ivan carsten - the house of house', '3'),
(33, 'Vinylshakerz - One Night In Bangkok', '-1'),
(34, 'The Whispers - And The Beat Goes On', '1'),
(35, 'X FILTER VS DJ HS - come on (djbries 2008 remix)', '5'),
(36, 'Djbries poogie style', '8'),
(37, 'tranceball - tranceball (ronald-v remix)', '6'),
(38, 'djbries my voice', '8'),
(39, 'Dj Chim k - Bouncer Kick', '9'),
(40, 'mr. noba and samuel sanders - do you like fuck (playboyz remix)', '6'),
(41, 'Loic D Feat. Dj Komy - Voice Generation - (Loic.D Remix)', '9'),
(42, 'For a Jumper - Greece 2000 (E-Max remix)', '9'),
(43, 'Qtushin - Sniff', '5'),
(44, 'Djbries On fire', '3'),
(45, 'Qatja S - Enfant Morbide', '1'),
(46, 'dj bries my mum', '2'),
(47, 'Deneck Traxx Feat Toxwen - French Massacre   Loic.D   Vek  Remix', '2'),
(48, 'Loic-D ', '4'),
(49, 'G-onikz ft DJ Bries - scratch !!! full', '3'),
(50, 'wordenz - game star full', '1'),
(51, 'Dr Rude - Musical Mezz  Ronald V Remix', '4'),
(52, 'Conservator - Save The Analog(Q-Ic remix)', '5'),
(53, 'Lethal Mg ', '2'),
(54, 'Greg C - Let', '2'),
(55, 'Ronald V - Ron', '11'),
(56, 'Vek - AntiBiotik', '4'),
(57, 'DJ Zof ', '1'),
(58, 'Yahn Ehsz - What iT (Rework)', '2'),
(59, 'DJ Brian C. - Intro Mix', '-1'),
(60, 'Loic.D - Speed Side', '4'),
(61, 'Dna Killerz - Partypeople (Original mix)', '3'),
(62, 'DHT - Uninvited (Owen G Remix)', '6'),
(63, 'Teka B - Pussy Love', '2'),
(64, 'Vek ', '2'),
(65, 'Zof ', '2'),
(66, 'Dj Chim!k - Bouncer Kick', '10'),
(67, 'DNA Killerz - Reckless (Original Mix)', '2'),
(68, 'TaMereLaPute', '10'),
(69, 'DJ Roy - Stronger', '1'),
(70, 'B1 - Wordenz - Game Star', '1'),
(71, 'b1-tranceball - tranceball (ronald-v remix)', '1'),
(72, 'Pushkin - Here We Go (Dj Bervin ', '4'),
(73, 'stunt trax - loop', '2'),
(74, 'coone - 15 - this is dirty (feat. ronald v)', '1'),
(75, 'low rider - Baglady(vek feat dna killerz remix)', '1'),
(76, 'oxley - a-one JK rmx', '1'),
(77, 'Dna Killerz - Cyber System (Original mix)', '1'),
(78, 'DJ Gave - Don', '5'),
(79, 'Bodyrox ', '4'),
(80, 'DJ Tboys - Theme majorette (Dr-X ', '1'),
(81, 'David Guetta - Lego El ritmo de verdad', '1'),
(82, 'Mary J Blige - Family Affair', '2'),
(83, 'Global Deejays - The Sound Of San Francisco', '1'),
(84, 'Yahn Ehsz - You Can See (R)', '1'),
(85, 'Dave davis - Transfiguration (Lethal MG Rmx)', '2'),
(86, 'Yahn Ehsz ft E-lex ', '1'),
(87, 'DJ Gave - Sucks', '2'),
(88, 'DHT - Jumping time (djbries 2008 remix)', '6'),
(89, 'Public Enemy vs Benny Benassi - Bring the noise(djbries feat mich remix)', '21'),
(90, 'chicago zone - scanner (djbries remix)', '3'),
(91, 'Ian Oliver Ft. Shantel - Bucovina (Lenny Warn', '1'),
(92, 'Yahn Ehsz - You Can See (Dna Killerz Remix)', '3'),
(93, 'DJ Yoeri - Fuck Me, I', '3'),
(94, 'Dr. Rude - Panic Power (DJ Gave aka G.Barj Rmx)', '2'),
(95, 'Major Bryce Schroum style', '1'),
(96, 'djbries your soul', '2'),
(97, 'Klap', '3'),
(98, 'Trash-P - C0M3 0N N0W', '1'),
(99, 'Prince - 1999 (Spank-E Ft. Conflict Remix)', '2'),
(100, 'djbries Fuckin tecktonik', '1'),
(101, 'Pride feat Maurizzio - Turn It Up ( Dj Chim!k remix )', '1'),
(102, 'JoH - Dj  Hypnotik', '2'),
(103, 'Atomik-V - Megamix Dj Gave', '1'),
(104, 'carat traxx the message(dj bries remix)', '3'),
(105, 'Culture Beat - Mr. Vain', '-1');
voila la stcture stable

Invité
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 13:35

Sinon voila son msn sa sera plus simple

[email protected]

merci a tous pour votre aide

ViPHP
ViPHP | 2287 Messages

28 févr. 2008, 13:39

CREATE TABLE IF NOT EXISTS `vote_club6tem` (
`id` int(5) NOT NULL auto_increment,
`titre` varchar(255) default NULL,
`score` mediumtext,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=106 ;
Ton ami devrait s'acheter une paire de lunettes. L'explication de Sékiltoyai est la bonne.
if(!@work()){ Nespresso(); } else { what(); }
______________________________

Invité
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 14:03

ok je vais lui dire merci encore

Invité
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 14:11

Bon il ne sais pas comment faire

voila son msn

[email protected]

ViPHP
ViPHP | 4039 Messages

28 févr. 2008, 14:32

Bon il ne sais pas comment faire

voila son msn

[email protected]
heum.. il est forumophobe ? Je crois pas que c'est à nous de prendre contact avec lui pour résoudre ton problème. S'il vient jusqu'ici, ce sera avec joie qu'on l'aidera, mais pour du service à domicile, je crois pas que c'est l'endroit. :roll:
Mais qu'importe. (je suis ici - dernier petit projet)
Berze going social.

NeODeS
Invité n'ayant pas de compte PHPfrance

28 févr. 2008, 14:48

Non lol je ne suis pas forumOphobe .

Simplement mon ami a pris contact avec vous sans que je le sache il viens de m'avisé de sa demarche a l'instannt donc oui voila je ne voie pas comment changer le varchar pour metre en int

Merci en tous cas pour votre aide

d0m
Mammouth du PHP | 1141 Messages

28 févr. 2008, 14:50

Tu peux le faire facilement avec une interface du type webmin/phpMyAdmin.

Sinon avec une requête SQL de ce genre :
ALTER TABLE Nom_de_la_table
MODIFY Nom_de_la_colonne Type_de_donnees