Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    cancellazione variabile

    ciao a tutti, ho questo codice

    echo "STAMPA 1 = $s1 - $s2 - $s3 - $s4 - $s5";

    $query = "update tabella set voted=voted+10,week=week+10 where id=$s1";
    mysql_query($query);

    $query = "update tabella set voted=voted+5,week=week+5 where id=$s2";
    mysql_query($query);

    $query = "update tabella set voted=voted+4,week=week+4 where id=$s3";
    mysql_query($query);

    $query = "update tabella set voted=voted+3,week=week+3 where id=$s4";
    mysql_query($query);

    $query = "update tabella set voted=voted+2,week=week+2 where id=$s5";
    mysql_query($query);

    echo "STAMPA 2 = $s1 - $s2 - $s3 - $s4 - $s5";

    il mio problema è che la stampa 1 viene stampata corretta, mentre la stampa 2 viene stampata senza l'ultima variabile.

    praticamente vedo

    STAMPA 1 = 123 - 124 - 125 - 126 - 127
    STAMPA 2 = 123 - 124 - 125 - 126 -

    come mai mi cancella l'ultima variabile ? (l'ultimo update non mi viene fatto, quindi presumo che appena fa la stampa 1 mi cancelli $s5..

    e non riesco a capire come mai..

    potete aiutarmi ?

  2. #2
    prova a farti stampare $s5 dopo l'esecuzione di ogni query per vedere in quale punto esattamente perdi il valore

  3. #3
    ottimo suggerimento grazie.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.