Why its not submitting data in another database?

If this is your whole code, so where is the part with the SUBMISSION?

How doy ou SUBMIT? Show your PROJECT-SETUP, first.
You surely are using a DATASET , don’t you ?

Must know knowledge - → Mixing CODE and DATASET-SETUPS are not the best idea and also not recommended.

Since you are using Wix-Data you normaly do not need any DATASETS, because all can be done by code.

You will have to generate CODE, which will save all your DATA into your wished DATABSE.