Help with MySQL Delete statement.?

i am trying to pass a value to the delete statement, how can this be done?

i have is the following:MySQL.Async.execute("DELETE FROM `table_name` WHERE `Id` = '3' ")

I would like to replace the "3" with the users input


the language i am using us lua and the following is me entire method. as you can see "delID" is being passed and that will contain the number i want to use instead if the "3" 


AddEventHandler('fsn_warehouse:removeWarehouses', function(delID)

    print("^6:fsn_warehouse:^0 Removing a new Warehouses")

    if delID == null then

        print("no id")


        MySQL.Async.execute("DELETE FROM `table_name` WHERE `Id` = '3' ")



1 Answer

  • EddieJ
    Lv 7
    2 months ago
    Favourite answer

    The MySQL DELETE statement is inside the parentheses, but the execute statement is probably in another language, maybe PHP.

    Do you know what language the execute statement is in?

    Aside from that, maybe 'Id' should NOT have squotes around it.

Still have questions? Get answers by asking now.