close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to pass child list value to next page?

Thread began 7/16/2010 5:39 pm by jeffmg279672 | Last modified 7/21/2010 10:36 am by jeffmg279672 | 5182 views | 27 replies

Dave BuchholzBeta Tester

Originally Said By: jeffmg279672
  I ran through the add review procedure using my local server, and the review was added to the db and I was redirected to the "thanks" page as anticipated, so I thought I'd cracked it, so I tried adding a second review, and got this error:
Duplicate entry '0' for key 2  



Jeff,

you are correct the error you are seeing is due to the fact that you are not inserting the practise_id into the table reviews, to solve this issue add a hidden field to your current form like so:

<input type="hidden" id="practiseID" name="practiseID" value="<?php echo $_POST['child'];" />



and then use this form in your database insert.

There is potentially another issue though as you have a field reviewers_id which will never get a value the way you have things set up currently as the standard dreamweaver database insert doesn't have an inbuilt method of creating a variable (session or global) that you can use to get the reviewers id from the insert into the reviewers table. It is possible to hand code a solution to this but I suspect that would not be your preferred option so if you have data assist you can get around this very easily by using the data assist insert server behaviour to do the insert to the reviewers table first with a blank redirect, this creates a session variable for the id of the record created that you can then use in the 2nd insert to the reviews table.

Hope that makes sense.

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