Search the Community
Showing results for tags 'help please friends'.
-
Hello friends, how can I know that the Login connection is correct with SQL? I want some message to appear in the debug script 3 that tells me that the connection is successful to the dbsql Or tell me failed connection.. local server ="test" local base ="test" local user ="test" local contra="test" 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("The account was created successfully Usero="..user.." Pass="..clave,source) setElementData(source,"usuario",user) setElementData(source,"clave",clave) enviar(codigo,correo,"Codigo+De+activacion",source) triggerClientEvent(source,"fActivar",source) else outputChatBox("Something has gone wrong contact an admin",source) end else outputChatBox("You can only have 2 accounts",source) end else outputChatBox("The account is already in use",source) end end addEvent("registrar",true) addEventHandler("registrar",getRootElement(),registrar)