close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Undefined variable error

Thread began 9/12/2014 10:59 am by gail.bergan407744 | Last modified 9/16/2014 11:37 am by Jason Byrnes | 1257 views | 9 replies |

gail.bergan407744

Undefined variable error

Hi again,

Now that our officer election is over, I'm updating our election pages using your MySQLi extension. See the attached file - when I make election choices and then hit Submit, I'm getting the following error messages:

Notice: Undefined variable: voterRecordset_i in /home/gcssepm/www/2014election_3.php on line 25

Fatal error: Call to a member function getColumnVal() on a non-object in /home/gcssepm/www/2014election_3.php on line 25

I've attached the file. Can you spot where I've gone wrong?

Gail

Attached Files
2014election_3.php
Sign in to reply to this post

Jason ByrnesWebAssist

In the update behavior, you are using the recordset bindings, you should be using the form bindings instead.

Sign in to reply to this post

gail.bergan407744

Hmmm. I made that change, and it got rid of the error messages, but the form is still not posting back to the database. File attached.

Attached Files
2014election_3.php
Sign in to reply to this post

Jason ByrnesWebAssist

Try using any form post as the update trigger.

Sign in to reply to this post

gail.bergan407744

Nope. It didn't make a difference. Any other ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

gail.bergan407744

see below

Sign in to reply to this post

Jason ByrnesWebAssist

looking at the source code for the page shows an error on the user id form element:

<input type="hidden" name="user_id" value="<br />
<b>Notice</b>: Undefined variable: row_voterRecordset in <b>/home/gcssepm/www/2014election_3.php</b> on line <b>540</b><br />
" />


the user id form element is using the old mySQL binding for the value:
<input type="hidden" name="user_id" value="<?php echo $row_voterRecordset['user_id']; ?>" />

it needs to be updated to use the MySQLi binding instead

Sign in to reply to this post

gail.bergan407744

Thank you Jason, that did the trick. The form is now posting properly.

Gail

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post
loading

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