1 Form, 3 fields into diffrent tables
Hi,
I got a form with 3 fields. For example, Province, City, Postcode. I want every field be stored in a diffrent table. does that work with DA?
Could it be that? Manage Relational Table!
Cheers,
Denis
Hi,
I got a form with 3 fields. For example, Province, City, Postcode. I want every field be stored in a diffrent table. does that work with DA?
Could it be that? Manage Relational Table!
Cheers,
Denis
For each of the tables you will use the Single Record Insert server behavior once. You can apply it 3 different times for the three different tables on the different fields being inserted.
So for your example, you would set up a Single Record Insert server behavior for Province, and then one for City and one for Postcode and they'd each be set up to insert into different tables.
Hi Jimmy (or anyone who can help),
As my query is similar I thought I'd tag onto this thread. Hope that's OK?
So, in my case I'm inserting into two tables from the one form
The second table is all from hidden fields. I have no problem with that. The problem is that one field within the second table is to insert the first tables ID number which is being made automatically with the auto-increment. I want that inserted into table two as a foreign key
Table 1 = tableID
Table 2 = FKtableID
Is that possible?
Many thanks.
so let me see if i understand what you want.
you insert into one table.
and want to insert the created ID into to next table as foreign key?
then use
mysql_insert_id()
for example.
between the 2 DA code blocks place:
<?php
$foreignKey = mysql_insert_id();
?>
then you can store the $foreignKey into the next DA code block
denis
Hi Denis,
That may just be explained a little simplisticly for me. If you assume I don't know much about PHP you'd be right. :)
I think I'm with you though so let me have a go and I'll get back to you.
Many thanks for your help.
Well Denis,
You are a genius :)
That worked a treat.
Many, many thanks.
P.S. I have to do the "update" now, having cracked the "insert". I'll let you know how I get on :)
Well, that was a breeze.
All because I don't have to update the second table. The "insert" to the second table is all hidden fields or session values. Once inserted they stay the same. Any updates only happen to the first table so no worries there.
Thanks once again for your help Denis.
Thanks Denis for help on John's issue.
John: I'm glad you got that all sorted out.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.