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

[closed] Mysql Question


  1. grg
    Member

    Hello,

    First, I'd like to say that this software is great. It simplifies a time consuming process: creating php/mysql forms that look good. I recently downloaded your software, and had it up and running on the web server in no time. I will recommend Machform to friends.

    I'm using the forms generated with Machform to collect data from a web page, and then import that data into a word document (using Open Office). I've been able to connect to the Mysql database through Open Office, and then import the data from the forms into word documents with ease. I've run into a bit of a problem, however...

    Specifically, the problem has to do with drop down menus and multiple choice questions on machform.

    For example: A drop down list (named element_1 in the mysql database) gives the following choices on the web view of the form: First Option, Second Option, Third Option. The data that is stored in the mysql database is 1,2,3. When I import all of the data from one form into a word document, I only get a number corresponding to the actual data for drop down lists and multiple choice questions. In other words, "First Option" shows up as the number 1 in the database. Other types of data from machform (names, numbers, and text for example) are imported fine.

    I realize this is probably a feature inherent in Mysql (in order to take up less disk space, maybe?). But I purchased this software in order to do this one specific task, and it's _almost_ working! Is there any easy fix for this issue? If not, is there any difficult fix? :) I'm willing to code a little bit if absolutely necessary.

    Thanks again for your help, and I'll be looking forward to future versions of Machform!

    Grg

    Posted 16 years ago #
  2. yuniar

    Hi Grg,

    I didn't know that OpenOffice support MySQL, sounds great, I'll give it a try.
    Are you using BASE?

    The choices labels are actually stored in different table. Check ap_element_options table, you'll see that all options go there.

    I haven't used OpenOffice before, but I'm sure there must be a way (or perhaps just write a raw SQL query) to relate two tables and display joined data.

    All you need to do is to join the data from your form table ap_form_XX and ap_element_options table.

    Are those sounds too difficult? If so, I'll try to came up with another solution.


    MachForm Founder

    Posted 16 years ago #
  3. grg
    Member

    That solution makes sense in theory. Basically, you join the two tables together, so that it would output the label instead of the numerical value? Would you know of a SQL query that would do that? I'm comfortable with using a raw SQL query, but I'm not talented enough with sql in order to come up with one myself.

    By the way, I am using base, which was a new feature in open office 2.0. It's not (yet) as full featured as, say, Access, but it does do a lot of things well (and it works great with machform, too!).

    Posted 16 years ago #
  4. grg
    Member

    Here's a couple of links that show you how to connect to a data source via Open Office, and then use the data from a data source to create dynamic documents.

    http://www.linux.com/feature/60185
    http://documentation.openoffice.org/manuals/oooauthors2/0211WG-UsingMailMerge.pdf

    Posted 16 years ago #
  5. yuniar

    Could you paste your table structure? SQL dump is enough.

    Here's a sample to do the join:

    select
          A.*,B.option
    from
          ap_form_99 A left join ap_element_options B
    on
          A.element_2=B.option_id and B.element_id=2
    where
          B.form_id=99


    on the above sample, my form_id is 99 and element_2 is the field name for the dropdown.
    you will need to adjust those to suit your needs.

    If you don't feel comfortable posting the detail here, please feel free send me private email to customer.service [at] appnitro.com

    I'll try to help you there.


    MachForm Founder

    Posted 16 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.