Skip to content
Advertisement

How to select table on DB using a dropdown?

Let’s say that I have two tables on my DB (table1 and table2, and both of them have the same structure.

JavaScript

My goal is to insert the data on the table that I’ll be deleting on the dropdown.

Sample if I select 1° semester on the dropdown all of the data will be added on the table1.

if I select 2° semester on the dropdown all of the data will be added on the table2.

This is what I have so far

JavaScript

Thanks in advance for any help

Advertisement

Answer

Just add a check before executing the query.

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