interesting situation

hbk

hbk

@hbk-UY6MQq Oct 25, 2024
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

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • xheavenlyx

    xheavenlyx

    @xheavenlyx-CbvN62 Jul 3, 2008

    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

    @hbk-UY6MQq Jul 3, 2008

    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

    @prasad-aSUfhP Jul 3, 2008

    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.