Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. juventissimo
    3. Discussioni
    J

    juventissimo

    @juventissimo

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 4
    • Post 24
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Località Venezia Età 35
    0
    Reputazione
    24
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User

    badges

    0
    Bookmarks
    0
    Voti
    0
    Ringraziamenti
    0
    Miglior risposte
    Inizia una nuova discussione
    di cosa vuoi parlare?

    Discussioni create da juventissimo

    • Topic
      Post
      View
      Votazioni
      Post
      Attività
    • J

      Mettere evento in corso con php e mysql
      Coding • • juventissimo  

      1
      316
      Visualizzazioni
      0
      Votazioni
      1
      Post

      Nessuno ha risposto

    • J

      Query non restituisce ordine alfabetico
      Coding • • juventissimo  

      13
      1700
      Visualizzazioni
      0
      Votazioni
      13
      Post

      J

      Bho, il fatto che io non ho modificato nulla rispetto al mio ultimo messaggio. Ci sarà stato forse un problema con il server mysql...

    • J

      Classifica sportiva in php e mysql con pannello amministratore
      Coding • • juventissimo  

      8
      4348
      Visualizzazioni
      0
      Votazioni
      8
      Post

      J

      Chiedo scusa se riapro questo topic, ma mi serve una query adatta per il mio database che consiste nella gestione di una squadra di calcio, compreso di tutto: risultati, classifica etc...
      io ho già creato un discreto database, solo che l'aggiornamento della classifica la devo fare io manualmente, infatti se per caso devo correggere un risultato devo cambiare manualmente anche la classifica.
      Io invece vorrei fare in modo che cancellando o modificando il risultato di una partita, anche la classifica modifichi in automatico, quindi ho pensato di creare la classifica direttamente attraverso una query, ho provato a costruirla ma purtroppo non mi visualizza nulla.
      quindi se qualcuno è disposto a darmi una mano allego tutto il database (sperando che lo capisca) e anche la query che ho provato ad eseguire.

      database

      -- -- Struttura della tabella `classifica2` -- CREATE TABLE IF NOT EXISTS `classifica2` ( `ID_classifica` int(20) NOT NULL AUTO_INCREMENT, `squadra` int(20) NOT NULL, `punti` int(100) NOT NULL, `vinte` int(20) NOT NULL, `nulle` int(20) NOT NULL, `perse` int(20) NOT NULL, `g_fatti` int(200) NOT NULL, `g_subiti` int(200) NOT NULL, `stagione` int(20) NOT NULL, PRIMARY KEY (`ID_classifica`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=55 ; -- -- Struttura della tabella `giornata` -- CREATE TABLE IF NOT EXISTS `giornata` ( `ID_giornata` int(20) NOT NULL AUTO_INCREMENT, `numero` int(2) NOT NULL, `data_partita` date NOT NULL, `stagione` int(20) NOT NULL, PRIMARY KEY (`ID_giornata`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=87 ; -- -- Struttura della tabella `partita` -- CREATE TABLE IF NOT EXISTS `partita` ( `ID_partita` int(20) NOT NULL AUTO_INCREMENT, `data_partita` date NOT NULL, `sq_casa` int(20) NOT NULL, `sq_fuori` int(20) NOT NULL, `goal_c` int(2) DEFAULT NULL, `goal_f` int(2) DEFAULT NULL, PRIMARY KEY (`ID_partita`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=720 ; -- -------------------------------------------------------- -- -- Struttura della tabella `squadra` -- CREATE TABLE IF NOT EXISTS `squadra` ( `ID_squadra` int(20) NOT NULL AUTO_INCREMENT, `nome` varchar(20) NOT NULL, `paese` varchar(20) NOT NULL, `stadio` varchar(20) NOT NULL, `descrizione` varchar(150) NOT NULL, PRIMARY KEY (`ID_squadra`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=37 ; -- -------------------------------------------------------- -- -- Struttura della tabella `stagione` -- CREATE TABLE IF NOT EXISTS `stagione` ( `id_stagione` int(20) NOT NULL AUTO_INCREMENT, `anno` varchar(7) NOT NULL, `descrizione` varchar(90) NOT NULL, PRIMARY KEY (`id_stagione`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

      query

      SELECT squadra, count(squadra) as partite, sum(if(punteggio=3,1,0)) as vittorie, sum(if(punteggio=1,1,0)) as pareggi, sum(if(punteggio=0,1,0)) as sconfitte, sum(punteggio) as punteggio, sum(fatti) as fatti, sum(subiti) as subiti FROM ( SELECT sq_casa as squadra, goal_c as fatti, goal_f as subiti, case when goal_c > goal_f then 3 when goal_c = goal_f then 1 else 0 end as punteggio FROM partita JOIN classifica ON partita.sq_casa = classifica.squadra WHERE classifica.stagione='$stagione' AND data_partita > '2010-09-01' union all SELECT sq_fuori as squadra, goal_f as fatti,goal_c as subiti, case when goal_f > goal_c then 3 when goal_f = goal_c then 1 else 0 end as punteggio FROM partita JOIN classifica ON partita.sq_fuori = classifica.squadra WHERE classifica.stagione='$stagione' AND data_partita > '2010-09-01' ) as tab ORDER BY punteggio DESC

      Sperando in un vostro aiuto
      vi ringrazio in anticipo

    • J

      Buon giorno a tutti
      Presentati alla Community • • juventissimo  

      5
      465
      Visualizzazioni
      0
      Votazioni
      5
      Post

      J

      Vero che siete il solito forum, ma avendo un regolamento così completo siete un forum d'eccellenza.