How to insert data into database using mysql Async | Is what I am doing correct?


#1

I have has numerous of attempts of doing this so could someone please tell me what I am doing wrong here?

MySQL.Async.execute("INSERT INTO moneyAccounts (identifier,cash,bank) VALUSE ('"..identifier.."','"..cash.."','"..bank.."')", {['@identifier'] = identifier, ['@cash'] = cash, ['@bank'] = bank})

error
image


#2

Bank is a nil value. Read the error next time :slight_smile:


#3

Yes I know its nil but dont understand why


#4
local _source = source
local money = 0
local bankmoney = 0
local identifier = GetPlayerIdentifiers(_source)[1]
MySQL.Async.execute("INSERT INTO moneyAccounts (identifier, cash, bank) VALUES (@Identifier,@cash,@bank)", {['@identifier'] = identifier, ['@cash'] = money, ['@bank'] = bankmoney})

Server side.