Hey
ich habe folgendes Script aus Wiki
Code
function RegisterPlayer(playerSource, commandName, _password)
local name = mysql_escape_string(handler, getPlayerName(playerSource)) -- Escape the strings to avoid SQL-Injection
local password = mysql_escape_string(handler, _password)
local query = "INSERT INTO account SET name='" .. name .. "', password=MD5('" .. password .. "')"
if (mysql_query(handler, query)) then
outputChatBox("Account created successfuly with id #" .. mysql_insert_id(handler), playerSource)
else
outputChatBox("An error has occured when trying to create your account.", playerSource)
end
end
addCommandHandler("reg", RegisterPlayer)
Alles anzeigen
Doch leider Funktioniert dieses nicht
Ich habe alle Daten geändert .... liegt es vllt daran das meine db mehr spalten als nur name und passwort hat ?
Bitte um Hilfe
EDIT:
Ich habe hier noch ein anderes Script wo er mir den Fehler ausgibt (der server ) :attempt to call local "passwort" (a string value)
Code
function RegisterPlayer(playerSource, commandName, _password)
local name = mysql_escape_string(handler, getPlayerName(playerSource)) -- Escape the strings to avoid SQL-Injection
local passwort = mysql_escape_string(handler, _password)
local query = "INSERT INTO `users` (Name,Passwort) VALUES ('"..name.."','"..passwort"')"
if (mysql_query(handler, query)) then
outputChatBox("Account created successfuly with id #" .. mysql_insert_id(handler), playerSource)
else
outputChatBox("An error has occured when trying to create your account.", playerSource)
end
end
addCommandHandler("reg", RegisterPlayer)
Alles anzeigen