Jump to content

itoko

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by itoko

  1. i hve other question, in the value of the colunm, if i put 100 it's for 100 accounts max?
  2. ok thx the table is created, but i have the same problem with all tonumber, its dont work, and the error table doesn't exist is now: error executing the save query: (1054) unkown column 'serial' in 'where cause' sry but i really dont know the sql
  3. yes i did it with navicat and it said me error, i did it with phpmyadmin too
  4. [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4 hmm sry i dont use mysql normally so
  5. is that i ask, what i put in? how i need to create it for my panel
  6. but when i create new table its ask me type, lenght and decimal
  7. they are no table, that the problem. and sorry i forgotten the error they are bad arguments #1 on all tonumber: value expected (to change the money, stats ect) and when i try change my personal details: error executing the save query: (line) table 'username.userdata' doesn't exist (i mean the sqlUsername)
  8. Hi, i have a problem with a panel script, by mysql database. The script is connected to the database, but there are no table in the database, so nothng can be saved, or loaded. The default table is 'userdata', but in the database, there are no table created and im not a very good scripter, so i ask your help. is there the mysql part of the script: -- Database connection info sqlHostname = "***.**.**.***" sqlUsername = "*********" sqlPassword = "*******" sqlDefaultDatabase = "*********" sqlDefaultTable = "userdata" -- Connect to the database function mySQLConnect() sqlConnection = mysql_connect(sqlHostname,sqlUsername,sqlPassword,sqlDefaultDatabase) end addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),mySQLConnect) -- Make a new entry to the mySQL database function checkSqlData(source) if (sqlConnection == nil) then mySQLConnect() end local player = source local serial = getPlayerSerial(player) local entryCheck = sqlConnection:query("SELECT serial FROM "..sqlDefaultTable.." WHERE serial='"..serial.."'") if (entryCheck) then local result = mysql_result(entryCheck,1,1) if (result == "") or (result == nil) then outputDebugString("New entry added to the mySQL database!") sqlConnection:query("INSERT INTO "..sqlDefaultTable.." (serial) VALUES ('"..serial.."')") sqlConnection:query("UPDATE "..sqlDefaultTable.." SET playerName='"..string.gsub(getPlayerName(player),"#%x%x%x%x%x%x", "").."' WHERE serial='"..serial.."'") end else outputDebugString("New entry added to the mySQL database!") sqlConnection:query("INSERT INTO "..sqlDefaultTable.." (serial) VALUES ('"..serial.."')") sqlConnection:query("UPDATE "..sqlDefaultTable.." SET playerName='"..string.gsub(getPlayerName(player),"#%x%x%x%x%x%x", "").."' WHERE serial='"..serial.."'") end end addEventHandler("onPlayerJoin",getRootElement(),checkSqlData) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() for i,player in ipairs (getElementsByType("player")) do checkSqlData(player) end end) -- Load data from the database function loadPlayerData (player,datatype) if (sqlConnection == nil) then restartResource(getThisResource()) end if (player) and (datatype) then local serial = getPlayerSerial(player) local findQuery = sqlConnection:query("SELECT "..datatype.." FROM "..sqlDefaultTable.." WHERE serial='"..serial.."'") if (findQuery) then local result = mysql_result(findQuery,1,1) if not (result == nil) then if not (result == "") then mysql_free_result(findQuery) return result else mysql_free_result(findQuery) return 0 end else return 0 end else --outputDebugString("Failed to get "..datatype.." for player "..getPlayerName(player).." @ findQuery") --outputDebugString("mysql_query failed: (" .. mysql_errno(sqlConnection) .. ") " .. mysql_error(sqlConnection)) end end end -- Save data to the database function savePlayerData (player,datatype,newvalue) if (sqlConnection == nil) then restartResource(getThisResource()) end if (player) and (datatype) and (newvalue) then local serial = getPlayerSerial(player) local saveData = sqlConnection:query("UPDATE "..sqlDefaultTable.." SET "..datatype.."='"..newvalue.."' WHERE serial='"..serial.."'") if (saveData == nil) then outputDebugString("Error executing the save query: (" .. mysql_errno(sqlConnection) .. ") " .. mysql_error(sqlConnection)) end end end i hope someone can help me. Regards, Itoko
  9. Hi, i want to show you all my maps, not a lot but for me are good . my v1 is too bad to make a video on [DM] Itoko v2 - Night Color [DM] Itoko v3 - Under The Moon [DM] Itoko v4 - I Dream [DM] Adrenalin Gamer I - Itoko Ft. Blackstar [DM] Itoko Ft. Osnet - Desert Rock All the maps are available on ~AG~ Server, thx for watching and see you online !
  10. just 'omg' its big nice map, with a beautiful trackmania objects, and not ripped, very good job ! =) i like the fail
×
×
  • Create New...