close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

UpdateGoTo not picking up ID from a recordset - only affecting one form?

Thread began 10/24/2016 7:16 am by Nathon Jones Web Design | Last modified 10/24/2016 7:22 pm by Ray Borduin | 1740 views | 4 replies |

Nathon Jones Web Design

UpdateGoTo not picking up ID from a recordset - only affecting one form?

I'm trying to redirect to a page on my site after an UPDATE, carrying over an ID so that I can dynamically show data once the MySQLi UPDATE form has been submitted:

$UpdateGoTo = "patient-view.php?pID=".$rsPATIENT->getColumnVal("PFpatientID")."";



When I get to the patient-view.php page, the URL is simply:
patient-view.php?pID=

So, it's not picking up the ID for some reason.

On my UPDATE page I am using that ID to filter a table from my database in a recordset called rsPATIENT, and I can display data from that table on the UPDATE page so the PFpatientID is absolutely available. So why isn't it carrying over once the UPDATE form has been submitted?

Worse still, I have another edit form on this site, using the same tables and recordsets, and it carries over just perfect, it's UpdateGoTo reference being exactly the same as this one. Aarrrggh.

I think this is a case of me going insane again but I attach the page in the hope that someone can spot the typo that I've spent 48 hours screaming at without seeing so far. I just can't see it. :(

Thank you
NJ

Sign in to reply to this post

markdoyle87077

When you submit the form the $rsPATIENT->getColumnVal("PFpatientID") will not exist; what I do is create a hidden form field and bind $rsPATIENT->getColumnVal("PFpatientID") to it and then use the post value of the hidden field to redirect to the correct page.

Sign in to reply to this post

Nathon Jones Web Design

Hi Mark. Thanks for jumping in.

$rsPATIENT->getColumnVal("PFpatientID") exists on the page. Is it only when the UPDATE form submits that it disappears?
If that's the case then why does it work on my other UPDATE form considering that the UpdateGoTo reference is the same?

Here's the reference on the form where it does work, on page (examination-view.php which I attach):

$UpdateGoTo = "patient-view.php?pID=".$rsPATIENT->getColumnVal("PFpatientID")."";



Here's the referece on the form where it's failing (examination-edit.php, also attached):

$UpdateGoTo = "patient-view.php?pID=".$rsPATIENT->getColumnVal("PFpatientID")."";



I'm completely stumped by this.
NJ

EDIT: As advised, I've created a hidden form field with the patient ID and have appended that to the redirect URL and, hey presto, it works fine.
I still have no idea why it works for one UPDATE form and not the other though.
Thank you Mark.

Attached Files
examination-edit.php
examination-view.php
Sign in to reply to this post

markdoyle87077

I see that the rsPATIENT recordset uses a where clause $_SESSION["patientIDfromrecord"] to get the record and this is set from the rsEDITEXAM recordset which relies on ((isset($_POST['eID'])?$_POST['eID']:"")) to get its results. When you do your update you are not reposting (isset($_POST['eID'])?$_POST['eID']:"") so rsEDITEXAM and rsPATIENT will not return any results and your update query will not redirect correctly. Hope this helps.

Sign in to reply to this post

Nathon Jones Web Design

Yup, that's the difference in the two forms. My confusion is that the redirect in the UPDATE form must be correct when you click the form's submit button because the patient ID is already called. So, submitting the UPDATE form has the effect of wiping all previous form posts. I wasn't aware of that.

Thank you Mark.
NJ

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