Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185

    errore Update si ma dove?

    UPDATE tabella SET top='5', left='5' WHERE id='1'


    mi dice
    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left='5' WHERE id='1'' at line 1

  2. #2
    i valori numeri NON vanno tra apici

  3. #3
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185
    ehehehehe non va uguale




    cmq il codice completo è questo


    $updateSQL = sprintf("UPDATE tabella SET top=%s, left=%s WHERE id=%s",

    GetSQLValueString($_POST['top'], "int"),
    GetSQLValueString($_POST['left'], "int"),
    GetSQLValueString($_POST['id'], "int"));


    $Result1 = mysql_query($updateSQL, $conn) or die("Errore nel file:".__FILE__. " alla linea ".__LINE__."".mysql_error());

  4. #4
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185
    cioè l'ho sempre usato cosi l'update e non mi ha mai dato problemi


    proprio non capisco

  5. #5
    ci sono anche TOP e LEFT che sono parole riservate. mettile tra backtick

    `TOP`

  6. #6
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185
    grandeeeee grazie optime non sapevo che top e left erano riservate
    grazie ancora ciao

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