SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    1 Form, 2 Input Fields, 1 Lookup Table

    Hi guys,

    I have a web app, where I have an input form, which includes 2 fields, SOURCE LANGUAGE and TARGET LANGUAGE.

    At the moment, I have two seperate tables, one for SOURCE and another for TARGET. This is a bit of a pain, as I have to maintain two tables instead of one.

    When I tried to use one table as a lookup for two different form fields, both values where the same, even though two different options where selected.

    Any ideas on how to use one table as a lookup for two fields in the same form?

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Can you explain a bit more? Give an example maybe?

  3. #3
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, here is the general idea of what I'm trying to do:

    TABLE LANGUAGES
    LANGID int(10) unsigned NOT NULL auto_increment,
    LANGNAME varchar(3) NOT NULL;

    TABLE JOBS
    JOBID int(10) unsigned NOT NULL auto_increment,
    FK_LANGID int(10) NOT NULL;

    FORM
    INPUT 1 = LANGUAGE 1 (FK_LANGID)
    INPUT 2 = LANGUAGE 2 (FK_LANGID)

    Problem is that although I select different values in the form, the same values are entered in MySQL.

  4. #4
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,506
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    It's not really giving an idea of what you're trying to do. It's technical info about your tables and two form fields. Useful, but not very descriptive
    Please try to describe in human language what the whole idea behind these tables and the form is (what does the user do and why, and what do you want to happen).
    And please post some code. It's hard to tell why things aren't going the way you want them to go, without some code to check

  5. #5
    SitePoint Addict
    Join Date
    Aug 2009
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not to worry, I've fixed the problem now, many thanks for your advice


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •