#Paper Posted January 31, 2011 Share 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? Link to comment
Aibo Posted January 31, 2011 Share 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. Link to comment
#Paper Posted January 31, 2011 Author Share 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... Link to comment
Aibo Posted January 31, 2011 Share Posted January 31, 2011 how exactly MySQL will help you in ignoring SQL syntax? Link to comment
#Paper Posted January 31, 2011 Author Share 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? Link to comment
Aibo Posted January 31, 2011 Share Posted January 31, 2011 have you tried to remove the dot? Link to comment
#Paper Posted January 31, 2011 Author Share Posted January 31, 2011 have you tried to remove the dot? ye Link to comment
Aibo Posted January 31, 2011 Share Posted January 31, 2011 ye what? ye where? what's the code? does it work? if not — what is the error? Link to comment
#Paper Posted January 31, 2011 Author Share 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: Link to comment
DakiLLa Posted January 31, 2011 Share Posted January 31, 2011 sry, ye, it don't works D: if not — what is the error? Link to comment
#Paper Posted February 1, 2011 Author Share Posted February 1, 2011 sry, ye, it don't works D: if not — what is the error? okok i solved Link to comment
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