interesting situation

hey guys... i've encountered something which I think may tax ur brains...

what im trying is this:

There is this coaching institute. A person may come here either as a student to enroll for a course, or as a teacher.

Now, if the person has come as a student, we enter into database DB1, the personal details and the course for which he wishes to enroll.(courses are in a drop down menu)

If the person is for a job, we enter into database DB2, the personal details, and the type of job he is here for.(types of jobs are al;so in a drop down menu).

So basically,

1. the user first enters whether he is a student/teacher. He is then redirected to a page asking for his personal details, and course(for student)/position(for teacher).

2. The data in the 2 cases is inserted into different databases.

the PRoblem

Ir-respective of whether the person is a student/teacher, i want to use a common page to ask for his details. This page, will obviously be connected to a different database based on student/teacher. Also, the drop-down menu on the page will depend on teacher/student.

I am unable to implement this...

somebody help me out...

thx...
cheers...

Replies

  • xheavenlyx
    xheavenlyx
    Ok, first of all is this an ofline problem or an online one?

    Secondly, which programing language are you using?

    It can be implemented depending on the above two questions.
  • hbk
    hbk
    xheavenlyx
    Ok, first of all is this an ofline problem or an online one?

    Secondly, which programing language are you using?

    It can be implemented depending on the above two questions.

    I am using PHP/MySQL on WAMP server. I dont understand what you mean by online/offline.

    please clarify..
  • Prasad Ajinkya
    Prasad Ajinkya
    Hi HBK,

    Have the common form post the variables to a php page. Are you using any framework, or is it plain PHP. If it is a plain php, then do NOT open the connection at the start of the page and close it at the bottom, choose to do this within a conditional statement (if-else).

    So your logic would be simple -
    if (student) {
    open db1 connection;
    process data;
    enter into db1;
    close db1 connection;
    } else if (teacher) {
    open db2 connection;
    process data;
    enter into db2;
    close db2 connection;
    } else {
    exceptions; // optional
    }

    Hope this helps.

You are reading an archived discussion.

Related Posts

I am dying to see the TV series LOST - 4th season. When I was in US i was able to access it online at following URL. ABC.com Full Episode...
hi i am kannappan dng ma engg @ chennai.......im very passionate abt xploring nw ideas........and i guess this site ll help me out.........๐Ÿ˜Ž
Any random ideas on improving forum activity? At present, the number of new members joining CE is greater than the number of posts we generate per day ๐Ÿ˜’.
I unofficially declare the installation of :- The CE Exclusive Club:200 โ€‹ ๐Ÿ˜๐Ÿ˜ All members with 200+ posts are eligible to join! ๐Ÿ˜ Rest - we look forward to having...
Hello Friends, Myself Harshil 3rd Year Computer Engineering Student. I Would Like To Share a New Topic Named Genetic Programming. I Have Given Three Seminars On This Topic. Genetic Programming...