cant insert data in a custom table in phpmyadmin

I would strongly suggest using AJAX for this purpose.

Using “init” for inserting some data to your database is not a good solution.

Here’s a good guide on how to do it with AJAX: https://webprogramo.com/how-to-create-an-ajax-form-in-wordpress/1156/