This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Retrieving Dropdown Values


  1. andylooney
    Member

    Hi, I have spent the week and 30+ hours trying to retrieve the dropdown values from mach form mysql tables and to display them on a table on my website. I have read the posts explaining how to do a left join, i have learned about joins on my own, etc. I have even tried to write my way around this problem -but to no avail. I'm am finally frustrated enough to ask for help.
    Basically, I am using machforms as a tool for my employees to enter in data about various local companies. After they enter that data, it is stored in a mysql database.
    I then have a form on my website that consists of a dropdown menu, a checkbox array, and a submit button. A visitor to my site is supposed to be able to select a county from the dropdown and a type of company from the checkbox array. Then this posts to a script which hunts for the matching listings in the machforms databse and displays relevant results in a table.
    Since most of the data is entered in machforms through dropdown boxes, the hard part is getting my php script to query the machforms database correctly. I have connected a few times -but cannot get this to work correctly. HELP!

    Posted 14 years ago #
  2. redityo

    You can use these SQL code to get drop down value from mysql :

    select
          A.*,
          B.option as element_6_value,
          C.option as element_7_value
      from
          (ap_form_271 as A
           left join ap_element_options as B
                  on A.element_6=B.option_id and B.element_id=6 and B.form_id = 271)
           left join ap_element_options as C
                  on A.element_7=C.option_id and C.element_id=7 and C.form_id=271

    You need to change the form id and element id in there with yours. For further information, you can see to these post :

    http://www.appnitro.com/forums/topic/drop-downs-and-mysql?replies=11


    MachForm Support

    Posted 14 years ago #
  3. andylooney
    Member

    Yeah, i found that post and the other one like it,but i can't seem to get that to work either.

    Posted 14 years ago #
  4. yuniar

    Hi Andy,

    Can you send us your current code please?
    Also, let us know the URL to your form as well.

    Please send to: customer.service [at] appnitro.com
    We'll help you there.


    MachForm Founder

    Posted 14 years ago #
  5. andylooney
    Member

    Okay, thanks!

    Posted 14 years ago #
  6. andylooney
    Member

    You guys got it! Thank you sooo much!

    Posted 14 years ago #
  7. fourward
    Member

    Where would that code go?

    Posted 11 years ago #
  8. yuniar

    The above code only refer to the SQL code that can be placed into any custom script or any code within machform files that execute SQL.


    MachForm Founder

    Posted 11 years ago #

RSS feed for this topic

Reply