Hi,

I want to select multiple option using check boxes(all values of checkboxes are come from database 1 ) and insert into the particular table in other database using php form.

Recommended Answers

All 2 Replies

Hmm, if i understand it corretly, you want to change databases depending on what boxes are selected? If you want users to select one option only, a switch would do.

switch($_POST["yourboxesnamehere"])
{
    case "A":
        *some SQL here*
        break;
    case "B":
         * some SQL here*
         break;
     case "C":
         *some SQL here*
         break;
}

(This is just out of the top of my head, it might have syntax errors)

If you want your users to be able to select multipl boxes at the same time, and upload their data in multiple databases at once, you'll need to use a lot of IF's.
It could turn out to be a lot of duplicate code yes, but you can't use 1 SQL tag to insert into multiple databases.

That said, i'm not sure wether it is possible to insert into multiple tables in one database. That calls for experimentation

Member Avatar for diafol

How about you include your code so far?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.