Add a value to a multi value list when updating
15 posts by 2 authors in: Forums > CMS Builder
Last Post: June 3, 2013 (RSS)
By gkornbluth - May 31, 2013
Hi Greg,
Sorry, but I’m at a loss again.
I’m trying to implement the add and remove values from a multi value list, and when using the email_address as the required matching value to determine which record to update:
If the first name, last name and email address entered are the same, the code works perfectly.
However, if the first and/or last name is not the same, I get “Undefined variable: recnumber2" errors, and I can’t figure out why. (I’ll probably feel dumb once more when I find out the answer)
Probably has a lot to do with how I’m retrieving the record number ($recnum2) of the record to be updated but can’t think of another way to retrieve it.
I’ve attached my latest version of the sign in file, but the code that has an issue is between line 56 and 117
Hope you have a moment to take a look.
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By gregThomas - May 31, 2013
Hi Jerry,
I don't mind having a look into the problem. Could you tell me the full error message you're getting? It would be useful to know which line the code stops working on.
Thanks!
Greg
PHP Programmer - interactivetools.com
By gkornbluth - May 31, 2013 - edited: May 31, 2013
Thanks Greg,
This is the complete error message:
Notice: Undefined variable: recnumber2 in /hsphere/local/home/a887307/elleschorrphotography.com/salon-sign-in-AWCf.php on line 86 Notice: Undefined variable: recnumber2 in /hsphere/local/home/a887307/elleschorrphotography.com/salon-sign-in-AWCf.php on line 96 Notice: Undefined variable: recnumber2 in /hsphere/local/home/a887307/elleschorrphotography.com/salon-sign-in-AWCf.php on line 100 Notice: Undefined variable: recnumber2 in /hsphere/local/home/a887307/elleschorrphotography.com/salon-sign-in-AWCf.php on line 109
If you need login info I can send it to your email
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
By gregThomas - June 3, 2013
Hi Jerry,
I've made a few minor changes to salon-sign-in-AWCf.php, I've indented all of the code in the two main functions so that its easier to read.
I found out what the main issue is, on your getRecords function for salon_listingsRecords on line 61 you didn't have allowSearch set to false. So it was going through and trying to match the record for the first name and last name of the user, when it should have just been looking for the user based on their e-mail address.
You might want to add some validation to the top of the page to check if the user has entered a correct first and last name to stop people entering anything for their first and last name.
Let me know if you have any questions.
Thanks
Greg
PHP Programmer - interactivetools.com
By gkornbluth - June 3, 2013
Hi Greg,
Thanks for finding the culprit.
I don't think you uploaded the changes that you made, but if allow search was the only change, I can make that change myself.
Actually, the client wanted to allow folks to change their names if they wanted to. (From formal to less formal, etc.)
Jerry Kornbluth
Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php