Mysql - Async HOW delete query

Hello friends, I would like to know if I am executing the query correctly to eliminate the rows from the table. I made the query in HeidiSQL and the syntax is correct. Someone can help me?

RegisterServerEvent(“rufus_adm_menu:deletereport”)
AddEventHandler(“rufus_adm_menu:deletereport”, function(args)
MySQL.ready(function ()
MySQL.Async. execute(‘DELETE FROM rufus_admin_report WHERE ident = @args;’,
{
[’@args’] = args
},
function()
end
)
end)
end)

I cant see something wrong with your query , its kinda hard to read because no spacing , do you have any errors and could you provide a screenshot instead?

2 Likes

Yo, if you’re not sure of the query, you should not be running this on a fivem server’s SQL DB - You need to run a backup instance of your database server on a different database so you can learn SQL;

There are really good free courses online in using SQL, but one of the ones I’m currently using and enjoying is the one on Udemy which costs like 20 bucks, but it’s worth it!

Anyways, moral of the story - you gotta educate yourself so that you’re not making a post everytime you need to run a command; That gets dangerous, fast!

friend, i post whatever questions i want, the same way i tolerate stupid answers like yours. It was not necessary to take any SQL courses, because I educate myself not to give up easily and seek knowledge.

Continuation of a great day for you.

I agree! I think that is 100% the right way to go, and apologies if I offended you, but let’s say you have an SQL server with tables that someone else has in their server. On your table is a column containing a primary key called “player ID.” You’re not sure whether or not you should delete it, so you come here.

And another player who ALSO has a table with a column called player ID sees your post. Only his column (ALSO Labeled player ID) is a foreign key referencing the player’s gunID. On HIS server, it’s safe to delete, but on YOUR server, it’s not. What if he says “YES! You can delete it!”

I hope you see the problem here; You’re likely to run into someone with less experience in SQL than you may have, and he may give you the wrong advice. The best thing to do (especially considering this isn’t an SQL forum) is to reach out somewhere where you KNOW you will get help from someone with SQL experience. There’s no guarantee you’ll get good SQL advice here.

Once again, I didn’t mean to come off as rude, but I don’t want you to screw over what sounds like a cool server listening to someone who isn’t qualified to help you. The intent of my last post was to:

  1. Encourage you to make a backup server JUST in case (learn from MY mistakes)
  2. Reach out somewhere where you can comfortably ask these types of questions!

Have a nice day!