close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Need to create a new record in my merchant table while at the same time creating a new user which inserts the new merchantID in the user table?

Thread began 10/02/2014 4:29 pm by david | Last modified 10/06/2014 7:59 am by Jason Byrnes | 1117 views | 5 replies |

david

Is it possible to insert two new records wit one form when one record is dependant on info from the other new record?

So my problem is this: I need to have merchants be able to log in and check their stats. My DB has a merchant table with all of their info.and a separate table for users which is used for logging in. My question is how to create records simultaneously on both tables?

These are my thoughts: is it possible to create a form that will insert a record into merchant table, retrieve that unique ID and then create a user where the ID is placed in a column on the user table?

OR

Should I be looking at having a two login systems. One that retrieves data from from the user table and then have a separate login for merchants and just have their credentials stored on the merchant table?

OR

Can you give me a better more simple solution that my inexperience won't allow me to find?

Thanks Guys!

Sign in to reply to this post

Jason ByrnesWebAssist

  is it possible to create a form that will insert a record into merchant table, retrieve that unique ID and then create a user where the ID is placed in a column on the user table?  




yes, use 2 Data Assist insert behaviors, In the data assist insert behavior, you can set the name of a session to save the inserted ID.

In the first insert behavior, make note of the session that will save the inserted ID, and use that session in the second insert behavior as the value for the relational column.

Sign in to reply to this post

david

Ok so to clarify... you said to save the "inserted ID" as a session variable, but the ID is being created by the DB with auto-increment and not being inserted into a form?


Follow up question.... I was really hoping to build all components of this site with the newer MySQLI since MySQL is deprecated. You guys have server behaviors for MySQLI login but nothing for Registration. If i use security assist to create the registration process with password recovery, remember me option and password update will I have any issues once my host upgrades to newer PHP versions? If so, does Webassist have plans to release a MySQLI registration server behavior? Last question, if I have to use Security Assist, is there an option for your team to help me convert it to MySQLI or PDO even if it cost me the $100 fee for help.

As always Jason, you and the Webassist team are appreciated! Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

Right, the server behavior will automatically retrieve the ID of the record being inserted and save it to a session.

registration is really just a form that uses an insert to save the users information, you can create the form, then use the insert behavior to save the registration to the users table.

We are currently working on upgrading Data Bridge to be compatible with MySQLi, but i do not have a time frame for when that will become available.

Sign in to reply to this post

david

So then can I use the MySQLI insert behavior to create the insert for the registration form? If that's the case how can make the password secure? I've done a little reading about hashing, salt, etc. Seems that Bcrypt is the best option currently. How can I implement that with my registration form?

Sign in to reply to this post

Jason ByrnesWebAssist

You would need to hand code the encryption of the password, the insert behavior does not have native support for encryption.

If you need help with this, we can help through a premiere support appointment:
http://www.webassist.com/premier_request.php

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...