Jump to content

Search the Community

Showing results for tags 'query'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 3 results

  1. The connection is okay but dbQuery and dbPoll first argument got nil. ( sorry for my bad english ) ERROR: MYSQL CONNECTION CODE: "felhasznalo" SCRIPT:
  2. Hello guys!How can i use the variables bannedBy, and accountID outside of this code block? local bannedBy local accountID for _, row in ipairs(query) local bannedBy = row["bannedBy"] local accountID = row["accountID"] end
  3. Hi guys, I'm trying to make a execute query function, this is what I got. But I seem to be doing something wrong. Server sided addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() connection = dbConnect(dbInfo["databaseType"], "dbname="..dbInfo["dbname"]..";host="..dbInfo["host"], dbInfo["username"], dbInfo[password]) if connection then outputDebugString("Connection with database was successfully established.") else outputDebugString("Connection with database couldn't be established.") end end) function execQuery (queryString) local query = dbQuery(connection, tostring(queryString)) if (string.find(queryString, "SELECT")) then local result = dbPoll(query, -1 ) if not result == nil then return result end end dbFree(query) end This I have server sided in another file for testing my db addEventHandler ("onPlayerJoin", getRootElement(), function () local query = execQuery("SELECT username FROM users WHERE username = '"..getPlayerName(source) .."'") if (query) then outputChatBox("found username: "..tostring(query[0])) else outputChatBox("didn't found username, inserting!") execQuery("INSERT INTO users VALUES('', '"..getPlayerName(source).."')") end end ) Also I'm not quite sure how to get the value since I'm returning a table atm. Kind regards P.S. my database looks like this
×
×
  • Create New...