[HELP] Can someone provide some clear guidence on how client / server trigger suppose to work?

I been stuck trying to get this to work by looking at how other people work client / server but I can’t seem to do it right. This is what I have from client:

After a bunch of stuff is done (randomly picking a fish from table, spawning it, etc… at the end I have this (just to try to save the caught fish to db)

TriggerServerEvent('FishToInv', name, price, status)

on my server

RegisterServerEvent('FishToInv')

AddEventHandler('FishToInv', function(name, price, status)

  TriggerEvent('es:getPlayerFromId', source, function(user)

    local player = user.identifier
    local name = name
    local price = price
    local status = status

	local executed_query = MySQL:executeQuery("INSERT INTO user_fish (`identifier`, `fish_name`, `fish_price`, `fish_status`) VALUES ('@username', '@name', '@price', '@status')",
	{['@username'] = player, ['@name'] = name, ['@price'] = price, ['@status'] = status})

  end)
end)

All I want it to do is just store it the db… nothing complicated I want to focus on this first then I can worry about inventory limit and all that can someone please help me out? what I am doing wrong?

Error: ScriptEnvironment::TriggerEvent: Error executing event handler for event es:getPlayerFromID in resource essentialmode: exception has been thrown by the target of an invocation

I already see 3 times this script on this forum.
Please keep one thread @maximilious , no need to open others

Really? this is the first time I posted this event part of my script with this particular situation, hence the new thread.

anybody can help at all?

bump, id like to fish as well

Can anyone tell me what I am doing wrong??

With the log, it says that you are trying to use a String …
Your issue is weird, can we have all the log ?

I fixed it, when I made my table I created a minI table within… I removed it and it fixed it lol 3 days :frowning: I got a hang of how it works now :slight_smile: