close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Handling 2 tables...

Thread began 2/26/2010 2:42 am by Paul | Last modified 3/01/2010 3:02 pm by Eric Mittman | 1258 views | 3 replies |

PaulBeta Tester

Handling 2 tables...

I'm looking for some guidance.

I am building a client registration system with the following behaviour...

A New Client completes and submits a 4-field registration form, populating Table A in a mysql database.

During registration, the client selects a value in the status field; either 1 or 2.

When a Registered Client logs in:

If the Status field value = 1, they are redirected (in the normal way) to the profile page and no further behaviour is required.

If the Status field value = 2, as above but an additional 15 fields are shown requiring completion and saving!

Now, the twist here is that these 15 fields exist in Table B of the same database.

For info..

- Session values, including a unique user id (from Table A) are captured during login.
- Table B carries a unique user id field
- Table B will only hold 1 record per 'matched' user in Table A

Ideas on how this can be accomplished gratefully received.

Thank you, Paul.

Sign in to reply to this post

Eric Mittman

One way you could do this is by storing the status field value in a session variable when the user logs in. This way you can check it on the profile page to determine weather to hide or show the additional fields.

If you are using Security Assist you can do this by creating a new rules for both statuses. You can then use these rules in the show region Security Assist server behavior.

On the profile page if the user has a status of one display the profile form and the submit button. If status is two display the profile form and hide the submit button and show the additional fields and the alternative submit button.

This way you can use the same page for both of these things. When it comes to the updates on this page there will be two. One for the profile and another for you table b. For the profile update you can choose based on same page submit, and for the additional update you can base it off of one of the required form fields for the additional info.

Please post back with any questions that you have about any part of this and we will be glad to help you get going in the rite direction with this.

Sign in to reply to this post

PaulBeta Tester

Originally Said By: Eric Mittman
  One way you could do this is by storing the status field value in a session variable when the user logs in. This way you can check it on the profile page to determine weather to hide or show the additional fields.

If you are using Security Assist you can do this by creating a new rules for both statuses. You can then use these rules in the show region Security Assist server behavior.

On the profile page if the user has a status of one display the profile form and the submit button. If status is two display the profile form and hide the submit button and show the additional fields and the alternative submit button.

This way you can use the same page for both of these things. When it comes to the updates on this page there will be two. One for the profile and another for you table b. For the profile update you can choose based on same page submit, and for the additional update you can base it off of one of the required form fields for the additional info.

Please post back with any questions that you have about any part of this and we will be glad to help you get going in the rite direction with this.  


Eric, thank you for your response.

I have successfully applied the session variable to determine the user status and have applied it to a couple of in-page show region server behaviours - this seems to be working well.

Because the fields in table B will total over 15, i have decided that I would prefer they are managed on a separate page.

I therefore think i'm going to need some fancy footwork to accomplish this behaviour.
For example, when a registered user logs in, I'm providing a link to this separate page containing the 15 plus fields, where the user can add or update the data in table B.

Any ideas on how I could approach this?

Sign in to reply to this post

Eric Mittman

I think you could have the user go to the same page based on the status, but when they go to page two you could redirect them to the intermediate page that has the additional fields on it. You can do it the same way by checking the status session variable. Once the user has made their selections on this additional page you could then send them off to the next page in the series.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...