Visualizzazione dei risultati da 1 a 10 su 10

Discussione: Query con data

  1. #1

    Query con data

    Ciao a tutti e buon natale.

    Devo fare una cosa del genere:

    Codice PHP:
    DELETE FROM presenti WHERE Giorno =! Oggi 

    Se tra un agnello e l'altro potete aiutarmi!


    ancora auguri
    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
    Utente di HTML.it
    Registrato dal
    Dec 2004
    Messaggi
    45
    Dipende in che formato è la data nella tabella del DB.

    Puoi fare un confronto tra i due TIMESTAMP.

    [ La vità è un'ostacolo ... superalo non evitarlo ! ]

    [ Il perdono è un'artifico inventato dall'uomo per ovviare all'irrepitibilità della storia. ]

  3. #3
    Giorno è un semplice camo DATE.
    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
    va bene una cosa del genere?

    Codice PHP:
    $query "SELECT UNIX_TIMESTAMP(Accesso) AS Accesso FROM pgu"
    $result mysql_query($query$db); 
    $off mysql_fetch_array($result);

    $query "SELECT * FROM pgu WHERE $off[Accesso] =! NOW()"
    $result mysql_query($query$db); 
    $off2 mysql_fetch_array($result);

    $query "DELETE FROM presenti WHERE Nick='$off2[Nick]'";
    $result mysql_query($query$db); 
    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

  5. #5
    no NOW() non va bene...forse mktime()???
    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
    up
    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
    perché NOW() non va bene?ti dà errori?
    io ho appena provato questa query su una mia tabella e funziona:
    codice:
    SELECT * FROM `name_tbl` WHERE data NOT LIKE NOW()
    prova ad eseguire la tua aggiungendo la notazione dell'errore e vedi se ti restituisce qualcosa [mysql_query($query)or die(mysql_error()); ]

    Talvolta anche una persona apparentemente inutile si rivela un abile samurai dalla forza di mille uomini, dimostrando di poter rinunciare alla vita e che il suo cuore si è completamente identificato con quello del suo padrone

  8. #8
    ehi grazie funziona così!
    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

  9. #9
    no spè...

    ..fatto in questo modo, cioè come mi servirebbe non va.
    Codice PHP:

    $query 
    "SELECT * FROM  presenti  WHERE Accesso LIKE NOW() ORDER BY `Nick` ASC";
    $result mysql_query($query$db); 
    n.b. cioè selezionare solo quelli che hanno effettuato l'accesso almeno da oggi
    dove Accesso è un campo DATE.
    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
    ah che scemo! Il LIKE con un campo DATE! SI usa =


    grazie lo stesso ciao
    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

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.