0

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.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by diafol
0

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

0

How about you include your code so far?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.