Jump to content

Search the Community

Showing results for tags 'result'.

  • 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 2 results

  1. when i try this code it's never insert datas into database pls help me... ) -- root = getElementRoot() addEventHandler("onPlayerLogin", root, function(_, account) outputChatBox(getPlayerName(source).." Giriş yapti.", root) local oyuncu = getPlayerName(source) local ip = getPlayerIP(source) local serial = getPlayerSerial(source) local username = getAccountName(account) local result = dbPoll( dbQuery( userdata_db, "SELECT * FROM masterdata WHERE username = ?", username ), -1 ) if type(result) ~= 0 then outputChatBox("#afafaf[#f9a52fSA:MP#afafaf] #f9a52fVeritabanina bir veri eklenmedi.",root, 255, 255, 255, true ) else dbQuery( userdata_db, "INSERT INTO masterdata VALUES (?,?,?,?,?)",username,serial,ip, '',oyuncu) end end) Console Log : Username = Asokanta WARNING: mysql/serverside.lua:22: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil] WARNING: mysql/serverside.lua:22: Bad argument @ 'dbPoll' [Expected dbquery at argument 1, got boolean] Username = deneme WARNING: mysql/serverside.lua:22: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got nil] WARNING: mysql/serverside.lua:22: Bad argument @ 'dbPoll' [Expected dbquery at argument 1, got boolean] I Fixed Here* It's giving only login logs but it still don't insert data in database when result isn't 0 New Console Log : LOGIN: (Everyone, Console) Asokanta successfully logged in as 'Asokanta' LOGIN: (Everyone) Asokanta successfully logged in as 'deneme' Database Screenshot :
  2. addEventHandler("onPlayerLogin", root, function() outputChatBox(getPlayerName(source).." Giriş yapti.", root) local oyuncu = getPlayerName(source) local ip = getPlayerIP(source) local serial = getPlayerSerial(source) local account = getPlayerAccount(source) local username = getAccountName(account) local qh = dbQuery( usedata_db, "SELECT * FROM masterdata WHERE username =?",username ) local result = dbPoll( qh, -1 ) if result == nil then local sorgu = dbQuery( userdata_db, "INSERT INTO `masterdata`(`username`, `serial`, `ip` ,`puan` , `name`) VALUES (?,?,?,'',?)",username,serial,ip,oyuncu) dbFree( sorgu ) else outputChatBox("#afafaf[#f9a52fSA:MP#afafaf] #f9a52fVeritabanina bir veri eklenmedi.",getRootElement(), 255, 255, 255, true ) end end) in here,i'm saying this : if this username don't exist in database insert data else do nothing. But when i try the script it gives nothing everytime like exist or don't exist usernames help pls.
×
×
  • Create New...