I want delete a row from a table in my db, i checked ox documentation without results, i’ve tried using MySQL.update.await(‘DELETE FROM …’), i get no errors but no line was deleted. Can someone tell me the right way?
̶̶̶u̶p̶d̶a̶t̶e̶̶̶ ̶i̶s̶ ̶u̶s̶e̶d̶ ̶f̶o̶r̶ ̶u̶p̶d̶a̶t̶e̶ ̶a̶ ̶r̶o̶w̶ ̶i̶n̶ ̶y̶o̶u̶r̶ ̶d̶a̶t̶a̶b̶a̶s̶e̶ . See Linden reply
Use query or rawExecute
MySQL.query('DELETE FROM players WHERE id', { playerID })
There is no difference in which function you use, it only affects the output – i.e. the response.
-- returns a table, containing affectedRows and other info.
MySQL.query.await('DELETE FROM players WHERE id', { playerID })
-- returns a number, equal to affectedRows.
MySQL.update.await('DELETE FROM players WHERE id', { playerID })