close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to insert multiple records with MySQLi server behaviours

Thread began 3/27/2018 9:15 am by jon211112 | Last modified 3/28/2018 11:23 am by Ray Borduin | 818 views | 3 replies |

jon211112

How to insert multiple records with MySQLi server behaviours

I have two tables - registrants and riders - and a form which contains fields for both tables. I want to process some of the fields and insert into the registrants table with a record. I then want to insert records into the riders table which has one field containing the ID of the newly inserted registrant record.

I've tried a number of ways to achieve this but none of them are working. I see you're close with a new version of the MySQLi Server Behaviours but it's still in beta so I'm reluctant to use it on a production site.

Can it be done with the existing version or should I go with the beta?

I don't want to use the previous Data Bridge as it's a new site so really needs to be running PHP7 and using MySQLi.

Cheers

Jon

Sign in to reply to this post

Ray BorduinWebAssist

As long as you are inserting one record at a time it can be done with the existing MySQLi Server behaviors.

You insert into the registrants table and save the ID in the session. Then go to the insert riders table and insert riders with the saved value from the session as the registrantID. Then set it to redirect to itself and show a table of existing registrants on the page with a done button that takes them back to their dashboard. You wouldn't need the BETA.

The BETA might be worth using since it would help you create the insert pages and tables. Since you can test everything locally first I wouldn't worry too much about using the beta on a live site. If you do have errors it would be in Dreamweaver or in getting the pages to work in the first place and then you could just choose not to upload them to the live site until they are working properly.

So... I'd personally use the beta, but you don't have to in order to get something like this working. A premier support ticket might be your best bet. Then I'd use the BETA and show you how I would do it.

I'd run the data assist wizard for both tables and then join the two with framework builder plugins and add the session variable relationships nad probably blow your mind a bit on how quickly and easily it could be done.

Sign in to reply to this post
Did this help? Tips are appreciated...

jon211112

Hi Ray

Thanks for the speedy reply. So I can't insert into multiple tables with a single form submission using the current MySQLi behaviours?

I think I'm going to break the process down into separate pages. It means a few more clicks but should be a lot tidier.

Cheers

Jon

Sign in to reply to this post

Ray BorduinWebAssist

Yes. You can apply the insert server behavior multiple times on the same page.

Sign in to reply to this post
Did this help? Tips are appreciated...

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