#Paper Posted January 31, 2011 Posted January 31, 2011 I have some problems: function onResStart () executeSQLCreateTable ( "mspserver.point", "serial TEXT, points INT" ) end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onResStart) -------------------------------- function onJoin () local serial = getPlayerSerial(source) local getPoints = executeSQLSelect("mspserver.point", "points", "serial='"..serial.."'") if getPoints == false then executeSQLInsert ( "mspserver.point", "'"..serial.."', '0'" ) setElementData(source, "Points", 0) else setElementData(source, "Points", tonumber(getPoints[1]["point"])) end end addEventHandler("onPlayerJoin", getRootElement(), onJoin) ---------------------------------------- function onPlayerQuit() local getActualPoints = getElementData(source, "Points") local serial = getPlayerSerial(source) executeSQLUpdate ( "mspserver.point", "points = '"..tonumber(getActualPoints).."'","serial = '" ..serial.. "'" ) end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) onJoin and onQuit says: "No such table: mspserver.point"... why?
Aibo Posted January 31, 2011 Posted January 31, 2011 probably because there's a dot (.) in your table name. which is used in SQL for «parent.child» reference like databaseName.tableName and since you don't have «mspserver» database, you cant create a table there. try removing the dot.
#Paper Posted January 31, 2011 Author Posted January 31, 2011 probably because there's a dot (.) in your table name. which is used in SQL for «parent.child» reference like databaseName.tableNameand since you don't have «mspserver» database, you cant create a table there. try removing the dot. mhh, maybe i will use a MySQL module...
Aibo Posted January 31, 2011 Posted January 31, 2011 how exactly MySQL will help you in ignoring SQL syntax?
#Paper Posted January 31, 2011 Author Posted January 31, 2011 how exactly MySQL will help you in ignoring SQL syntax? nono, SQL is better than MySQL btw, can you fix my script?
Aibo Posted January 31, 2011 Posted January 31, 2011 ye what? ye where? what's the code? does it work? if not — what is the error?
#Paper Posted January 31, 2011 Author Posted January 31, 2011 ye what? ye where? what's the code? does it work? if not — what is the error? sry, ye, it don't works D:
DakiLLa Posted January 31, 2011 Posted January 31, 2011 sry, ye, it don't works D: if not — what is the error?
#Paper Posted February 1, 2011 Author Posted February 1, 2011 sry, ye, it don't works D: if not — what is the error? okok i solved
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