Edikosh998 Posted February 15, 2012 Share Posted February 15, 2012 Hi everyone, I've got a problem with SQL syntax : function SQLTableStart() executeSQLCreateTable("jugadores", "Name TEXT,columnAccount TEXT") executeSQLCreateTable("cordes","ID STRING,columnX FLOAT,columnY FLOAT,columnZ FLOAT") end addEventHandler("onResourceStart",resourceRoot,SQLTableStart) function creacio(_,account) local dataDos = getAccountData(account,"edad") local username = getAccountName(account) local name = getPlayerName(source) if account then local data = getAccountData(account,"LARP.player") local dataDos = getAccountData(account,"LARP.Actual") local dataTres = getAccountData(account,"LARP.edad") if not data then showCursor(source,true) triggerClientEvent("onCreation",source,source) sql.Query("INSERT INTO jugadores (Name, columnAccount) VALUES ('d','"..username.."')") -- Here is the problem sql.Query("INSERT INTO cordes (ID, columnX, columnY, columnZ) VALUES ('"..username.."','','','')") end end end Problem : --No column named Name Link to comment
Castillo Posted February 15, 2012 Share Posted February 15, 2012 Are you sure it exists? have you checked the table manually? Link to comment
Kenix Posted February 15, 2012 Share Posted February 15, 2012 addEventHandler( "onResourceStart",resourceRoot, function( ) executeSQLQuery( "CREATE TABLE IF NOT EXISTS jugadores ( Name TEXT,columnAccount TEXT )" ) executeSQLQuery( "CREATE TABLE IF NOT EXISTS cordes ( ID STRING,columnX FLOAT,columnY FLOAT,columnZ FLOAT )" ) end ) function creacio( _,account ) local username = getAccountName( account ) if account then local data = getAccountData( account,"LARP.player" ) if not data then showCursor( source,true ) triggerClientEvent( "onCreation",source,source ) executeSQLQuery( "INSERT INTO jugadores VALUES ('','"..username.."')" executeSQLQuery( "INSERT INTO cordes VALUES ('"..username.."','','','')" ) end end end addEventHandler( 'onPlayerLogin',root,creacio ) 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