Adding data into multiple database tables

mi mik0392 30 Nov, 2010
Hello there.

Before I start, i would like to say that my php knowledge is next to nill, otherwise I would do this myself, but the time it would take to learn php would take too long, and I need this done before i could learn 😟

What I would like to do is use Chronoforms to submit all of my data info into two differant tables

Currently what I am trying to do is use the web form, as an easy method of doing an application process for my users. And when they hit submit, the information from the form goes into my forum (Kunena Forum) as a new thread.

For this to happen, the tables that need to edited are:

jos_kunena_messages; (thread)
jos_kunena_messages_text; (posts, including the first post that created the thread)

The first table, tells the forum the name/subject of the thread. What I would like for the subject field is "Application - {field1} {field2}" field1 and 2 being fields from the web form. This is pretty much what this table needs.

the second table is more difficult.

This table holds all the information for every post on the forum.

What needs to be done, is in the text field of the table (where the text in the post goes) is all the information that would appear in the email version of the submitted web form.

Also the username ID of the current logged in user who made the web form (must be registered to access my form) to be put into the username column of the table.

Also each entry in the tables must have a unique ID.

Examples--

Table 1 (thread)


Unique ID | Thread | Category | UserID | Subject                    |
   1      |   11   |   5      |  36    | Application - John Citizen |


Table 2 (post)

messageid | Message                                                |
   11     |    <entire form that would appear in the email result> |


If anyone can help with this, if you can understand what i would like, this would mean a lot for myself and many users who have the same issue on the Kunena forums.

Much appreciated,

Thank you.

Mike.
Gr GreyHead 30 Nov, 2010
Hi mik0392,

I know nothing about kunena . . .

ChronoForms will save to two tables if you select both in the DB Connection drop-down; they both have integer primary keys; and you've carefully matched up the input names with the column names.

There's a doc with more info here.

Bob
This topic is locked and no more replies can be posted.