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

    UPDATE banale da rompicapo

    Scusatemi ma sono nel panico.
    Un UPDATE che in locale funziona, quando lo faccio girare sul server vero e proprio mi da questo errore:

    Fatal error: Call to undefined function: error_message() in /web/htdocs/www.miositoprova.it/home/php/esegui_modifica.php on line 34

    Premetto che tutte le INSERT e DELETE funzionano che sono una bellezza... e che per prova ho messo 4 echo all'inizio della pagina: queste variabili sono esatte e vengono messe a video correttamente.

    Il codice della pagina esegui_modifica.php è questa:
    codice:
    <? echo $table; ?>
    
    <? echo $risultato; ?>
    
    <? echo $luogo; ?>
    
    <? echo $ID; ?>
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>
          PANNELLO ADMINISTRATOR
        </title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link href="../css.css" rel="stylesheet" type="text/css">
      </head>
      <body background="../img/sfondo_back.gif">
        <table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td>
              [img]../img/HEADER.jpg[/img]
            </td>
          </tr>
          <tr>
            <td bgcolor="#333333" height="5">
            </td>
          </tr>
          <tr>
            <td bgcolor="#333333" align="center">
    <?
    $db=mysql_connect("44.44.44.44","user","password");
    mysql_select_db("database", $db);
    $query = "UPDATE $table SET luogo = '$luogo', risultato = '$risultato' WHERE ID = '$ID' ";
    $result=mysql_query($query, $db);
    	if (!$result) error_message(sql_error());  // QUESTA E' LA RIGA 34
    	
    	else {
    		echo "
    
    <font color=\"#FFFFFF\"><h4>aggiornamento completato!</h4>
    
    ATTENDERE PREGO...<meta http-equiv=\"refresh\" content=\"3 url=amministrazione.php\"></font></p>";
    		}
              ?>
              
    
    
    <?
    	include("back_close.php");
                ?>
              </p>
              
    
              <tr>
                <td bgcolor="#999999"></td>
              </tr>
        </table>
      </body>
    </html>
    THANKS for your help!!!
    *** You shouldn't compare yourself to the best others can do but to the best you can do ***

  2. #2
    error_message dove lo hai definito scusa?

    potresti anche mettere una cosa come:


    echo "

    <font color=\"red\"><h4>aggiornamento fallito!</h4>

    ".mysql_error()."</p>";

  3. #3

    ok, ma...

    questo è vero... ma il problema sta nel fatto che la stessa pagina php, nel mio pc locale funziona mentre sul server che mi fa hosting mi da l'errore!!
    Può darsi che ci sia un settaggio particolare sul server (Aruba), che mi fa sbarellare l'UPDATE?
    Il Database l'ho creato sul mio pc e l'ho esportato e reimportato correttamente nel server Aruba (procedimento che faccio sempre).

    AIUTO!!
    *** You shouldn't compare yourself to the best others can do but to the best you can do ***

  4. #4

    PERDONATEMI

    chiedo scusa a tutti...
    ho trovato l'errore.

    Mancava una "2" nel nome del database.

    E ieri sono stato due ore a tentare di capire il perchè non funzionava...

    *** You shouldn't compare yourself to the best others can do but to the best you can do ***

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.