Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 24

Discussione: Campo TIMESTAMP

  1. #1

    Campo TIMESTAMP

    Ciao io ho un campo timestamp in tabella chiamato Ultima.

    ed ho questa query:
    Codice PHP:
    $query "SELECT Nick,Stato,Simbolo,Status,UNIX_TIMESTAMP(Ultima) AS Ultima,Ultima_Arma,Salute FROM pgu WHERE Nick='$user_id'"$result mysql_query($query$db);
    $wer mysql_fetch_array($result); 
    ed ho questa condizione che se passano almeno 10 minuti dall'ultimo aggiornamento del campo Ultima allora si va avanti con la funzione
    Codice PHP:
    if((Time() - $wer[Ultima]) > 600)  { 
    il problema che non mi va così...mi da quasi sempre else della condizione ovvero echo"non sono passati 10 minuti ecc..." come mai?
    thx
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  2. #2
    perchè la condizione non la fai controllare direttamente al DB ?? nella clausola WHERE intendo
    <?php echo ' Emiliano Gabrielli (aka AlberT) ',"\n",
    ' socio fondatore e membro del direttivo del GrUSP ',"\n",
    ' AlberT_at_SuperAlberT_it - www.SuperAlberT.it ',"\n",
    ' IRC: #php,#AES azzurra.com ',"\n",'ICQ: 158591185'; ?>

  3. #3
    in che modo? non ho capito...
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  4. #4
    non ricordo perfettamente la sisntassi, ma qualcosa del tipo:

    WHERE NOW()-UNIX_TIMESTAMP(Ultima)>600
    <?php echo ' Emiliano Gabrielli (aka AlberT) ',"\n",
    ' socio fondatore e membro del direttivo del GrUSP ',"\n",
    ' AlberT_at_SuperAlberT_it - www.SuperAlberT.it ',"\n",
    ' IRC: #php,#AES azzurra.com ',"\n",'ICQ: 158591185'; ?>

  5. #5
    spè che provo grazie...
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  6. #6
    ehm??

    ma, in quale query va questa?
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  7. #7
    tipo così?

    Codice PHP:
    $query "SELECT Nick,Stato,Simbolo,Status,Ultima,Ultima_Arma,Salute FROM pgu WHERE Nick='$user_id' AND  NOW() - UNIX_TIMESTAMP(Ultima)>600"$result mysql_query($query$db);
    $wer mysql_fetch_array($result); 
    solo che ora che fo? cioè se la condizione l'ho sostituita con la clausola nella query, come faccio a farla?
    faccio if($results) { ???
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  8. #8
    codice:
    $query = 
    "SELECT  
           Nick,Stato,Simbolo,Status,
           UNIX_TIMESTAMP(Ultima) AS Ultima,
           Ultima_Arma,Salute 
    FROM 
           pgu 
    WHERE 
           Nick='$user_id' 
    AND
           (NOW()-UNIX_TIMESTAMP(Ultima)>600)";
    
    $result = mysql_query($query, $db) or print(mysql_error());
    if (mysql_num_rows($result)<=0) {
           echo "troppo presto";
           return FALSE;
    }
    $wer = mysql_fetch_array($result);
    ...
    <?php echo ' Emiliano Gabrielli (aka AlberT) ',"\n",
    ' socio fondatore e membro del direttivo del GrUSP ',"\n",
    ' AlberT_at_SuperAlberT_it - www.SuperAlberT.it ',"\n",
    ' IRC: #php,#AES azzurra.com ',"\n",'ICQ: 158591185'; ?>

  9. #9



    continua a non andare!!!!
    http://codecanyon.net/category/all?ref=Manuelandro
    And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
    memories to be made

  10. #10
    che tradotto che significa?
    <?php echo ' Emiliano Gabrielli (aka AlberT) ',"\n",
    ' socio fondatore e membro del direttivo del GrUSP ',"\n",
    ' AlberT_at_SuperAlberT_it - www.SuperAlberT.it ',"\n",
    ' IRC: #php,#AES azzurra.com ',"\n",'ICQ: 158591185'; ?>

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 © 2025 vBulletin Solutions, Inc. All rights reserved.