Skip to content
Advertisement

How to bulk insert dropdown select data into mysql

The code below is for inserting data into mysql tables. I am only able to insert data successfully into two of the three.

A headsup: Table name – wp_form_inputs which stores the form_id and the ids of the dropdown selects enter image description here Then this one stores the options of the selects above enter image description here

Where I am inserting data into:

JavaScript

The 3rd table wp_appointment_custom_data which won’t insert. How saved data looks like. enter image description here

CODE

JavaScript

FORM

JavaScript

Unable find what I’m doing wrong. JS code duplicates the form for bulk insert. I didn’t see the need to add it.

Advertisement

Answer

An array assignment with same key will override previous assignment

JavaScript

you have to insert three times respective to input types

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement