Visualizzazione dei risultati da 1 a 4 su 4

Discussione: query

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929

    query

    ciao a tutti,

    come posso controllare se una query è riuscita...

    in pratica se la query ha avuto successo mi deve reidirizzare altrmineti no
    codice:
    $sql = mysql_query($query_sql, $connessione) or die(mysql_error());
    if($sql == true){
    header("Location: ../../index.htm");
    }
    Grazie

  2. #2
    Utente di HTML.it L'avatar di Il_Drugo
    Registrato dal
    May 2006
    Messaggi
    1,220
    Codice PHP:
    if(mysql_query($query_sql$connessione) or die(mysql_error()))
    {
       
    header("Location: ../../index.htm");


  3. #3

    ...........

    Ciao.
    Sto manuale mysql_query
    se c'è ci sarà una ragione
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  4. #4

    ......

    Codice PHP:
    if(mysql_query($query_sql$connessione) or die(mysql_error()))
    {
       
    header("Location: ../../index.htm");

    forse così è preferibile:
    Codice PHP:
    if(!mysql_query($query_sql$connessione))
    {
      die(
    'Invalid query: ' mysql_error());
    }
     
    header("Location: ../../index.htm"); 
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

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.