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

    Non funziona la query di Update

    Hola!

    Cosa c'è che non va in questo coidce perchè non esgeue la query di update? Nessun errore ma i dati nel dbase non si aggiornano... :
    codice:
    <%
    FUNCTION SaveAccount()
    	on error resume next
    	call gereConn(1)
    	aux = "UPDATE USERS SET User_Nick = '"& nick &"', User_Pwd = '"& pwd &"', User_Color = '"& cor &"', User_Room = '"& room &"', User_Email = '"& email &"' WHERE User_Nick LIKE '"& nick &"';"
    	conn.Execute(aux)
    	if conn.Errors.Count > 0 then	
    		msg = null
    		msg = "See Error Message(s)
    
    "
    		SaveAccount = false
    		conn.Errors.Clear
    	else
    		SaveAccount = true
    	end if
    	call gereConn(0)
    END FUNCTION
    
    Dim nick, pwd, room, cor, lista, cortd, msg, modo, InfoNick, status, sacc
    
    modo = request("MODO")
    msg = request("MSG")
    
    if Len(room & "")=0 then room = "LabDev"
    if Len(cor & "")=0 then cor = "Black"
    
    if modo = "SAVE" then
    	nick = Replace(request("NICK"),"'","''",1,-1)
    	pwd = Replace(request("PWD"),"'","''",1,-1)
    	email = Replace(request("EMAIL"),"'","''",1,-1)
    	room = request("ROOM")
    	cor = request("COR")
    	
    	sacc = SaveAccount()
    	if sacc then
    		Response.Write "
    <h5 style='text-align: center'>Modifica mis datos</h5>
    
    "
    		Response.Write "<fieldset align=center style='width: 80%; border: 1px solid Black'><legend style='margin-left: 12px;'>[<b style='color: Blue'>Modifica mis datos[/b]]</legend>"
    		Response.Write "<div align=center>
    <h5 style='color: Green'>Datos modificados!</h5>
    
    Los nuevos datos seran disponible al proximo login.</p>"
    		Response.Write "
    Salir | "
    		Response.Write "Cerrar Ventana
    
    
    </div></fieldset>"
    	else
    		Response.Write "
    <h5 style='text-align: center'>Modifica mis datos</h5>
    
    "
    		Response.Write "<fieldset align=center style='width: 80%; border: 1px solid Black'><legend style='margin-left: 12px;'>[<b style='color: Blue'>Modifica mis datos[/b]]</legend>"
    		Response.Write "<div align=center>
    <h5 style='color:Red'>Los datos no se modificaron a causa de un error!</h5>
    
    Please Logout, Login, and try again.</p>"
    		Response.Write msg
    		Response.Write "
    Salir | "
    		Response.Write "Cerrar ventana
    
    
    </div></fieldset>"
    	end if
    	Response.End
    end if
    %>
    
    <form name="frmManage" action="myaccount.asp" method="POST">
    <input type="hidden" name="MODO" value="SAVE">
    
    
    <pre>Usuario:	<input type="text" name="NICK" value="<%=Session("NICK")%>" style="width: 134px;" size="20">
    Password:	<input type="password" name="PWD" value="<%=Session("PWD")%>" style="width: 134px;" size="20">
    
    Email:	<input type="text" name="EMAIL" value="<%=Session("EMAIL")%>" style="width: 134px;" size="20">

  2. #2
    Rettifico:

    -l'unico campo che non si aggiorna è quello del nick_user...

  3. #3
    Non puoi aggiornare un campo su cui fai il WHERE , che senso ha ??? :master:

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.