xRGamingx Posted December 14, 2016 Posted December 14, 2016 Hello friends, why does this error throw me the login panel? if everything is fine What is the error.. local server ="127.0.0.1" local base ="Proyectotg" local user ="root" local contra="" function registrar(user,clave,correo) cnn = dbConnect( "mysql", "dbname="..base..";host="..server,user,contra,"share=2") res = dbQuery( cnn,"select count(codCuentas)as nombre from cuentas where usuario='"..user.."';") result = dbPoll( res, -1 ) if(result[1]["nombre"]==0)then serial = getPlayerSerial(source) res = dbQuery( cnn,"select count(codCuentas)as nombre from cuentas where serialPlayer='"..serial.."';") result = dbPoll( res, -1 ) if(result[1]["nombre"]<100)then a,b,c = tostring(math.random(100,800)),tostring(math.random(100,800)),tostring(math.random(100,800)) codigo = a..b..c fail= dbExec( cnn, "INSERT INTO cuentas(usuario,clave,correo,serialPlayer,codigo,cambio,can,activa) VALUES (?,?,?,?,?,?,?,?)",user,clave,correo,serial,codigo,0,0,0 ) if(addAccount(user,clave))then outputChatBox("Se creo l cuenta con exito Usuario="..user.." contraseña="..clave,source) setElementData(source,"usuario",user) setElementData(source,"clave",clave) enviar(codigo,correo,"Codigo+De+activacion",source) triggerClientEvent(source,"fActivar",source) else outputChatBox("Algo a salido mal contacta a un admin",source) end else outputChatBox("Solo puedes tener 2 cuentas",source) end else outputChatBox("La cuenta ya esta en uso",source) end end addEvent("registrar",true) addEventHandler("registrar",getRootElement(),registrar)
ViRuZGamiing Posted December 14, 2016 Posted December 14, 2016 There's an error with the connection, without a connection you can't execute queries and such. Check your users, I think you should use 'root' as username but check users in PHPMyAdmin "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now