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

Discussione: Ultimo id inserito

  1. #1

    Ultimo id inserito

    Ho gia letto sul forum ma non sono riuscito a realizzare nulla,
    io ho una tabella news mi serve poter stampare anche solo il valore dell'ulimo id inserito in quella tabella, come faccio?
    grazie

  2. #2

    Re: Ultimo id inserito

    Originariamente inviato da nicaragua90
    Ho gia letto sul forum ma non sono riuscito a realizzare nulla,
    io ho una tabella news mi serve poter stampare anche solo il valore dell'ulimo id inserito in quella tabella, come faccio?
    grazie
    SELECT MAX(id) FROM TABELLA


    Il silenzio è spesso la cosa migliore. Pensa ... è gratis.

  3. #3
    hm...ma nn andrebbe bene anke Limit 0,1 ??

    :master:
    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
    scusate sono proprio scarso in php ma non so proprio come stamparlo
    potreste gentilmente scrivermi la query ed il modo per stamparlo

  5. #5
    Codice PHP:
    $query "SELECT MAX(id) FROM tabella"$result mysql_query($query$db); 
    $row mysql_fetch_array($result);

    //per stamparlo//

    echo "$row[id]"
    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
    <?
    $query = "SELECT * FROM news ORDER BY id DESC LIMIT 0,1";
    $result = mysql_query($query, $nome_db);
    mysql_fetch_array($result);
    ?>


    oppure

    <?
    $query = "SELECT MAX(id) FROM news";
    $result = mysql_query($query, $nome_db);
    mysql_fetch_array($result);
    ?>

    ?? e poi per stamparla

  7. #7
    scusa non avevo letto adeso provo

  8. #8
    te l'ho scritto...

    cmq usa il metodo che ti ha detto piero!!
    del mio nn sono sicuro!!
    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
    PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in E:......

    ottengo questo

  10. #10
    c'è un errore nella query...

    controlla di aver scritto i nomi dei campi giusti!
    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 © 2024 vBulletin Solutions, Inc. All rights reserved.