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

Update:

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" 

RegisterServerEvent('fsn_warehouse:removeWarehouses')

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

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

    if delID == null then

        print("no id")

    else

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

    end

end)

1 Answer

Relevance
  • EddieJ
    Lv 7
    3 weeks ago
    Favorite 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 your answers by asking now.