This topic is locked
[SOLVED]

 User Registration

9/6/2010 10:39:14 PM
PHPRunner General questions
W
wildwally author

Found a similair post but it was locked, nothing was truely shown just pointed to SQL site. I need a little more guidance than that.
Trying to pass a default value into the user table for the newly registered user.
global $conn;

$strSQLInsert="insert into _users (Status) values ('Pending') where Email = $userdata["email"]";

db_exec($strSQLInsert,$conn);
Whats wrong with this?

D
Dale 9/7/2010

Try quoting

Email = '".$userdata["email"]."'";

W
wildwally author 9/7/2010



Try quoting

Email = '".$userdata["email"]."'";


No go, i've tried every possibility along the lines with quotes and apostraphies. Not sure if you noticed there was an odd ball in your suggestion?
[size="+1"]Technical information[/size]Error type256Error descriptionYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where Email = ''' at line 1URLlocalhost/Project_VA/register.php?Error file**\*\***\*****\output\include\dbconnection.phpError line36SQL queryinsert into _users (Status) values ('Pending') where Email = ''

Sergey Kornilov admin 9/7/2010

What's your version of PHPRunner and which event do you use?
According to what I see $userdata["email"] is empty. This means you either using a wrong event or field name is misspelled i.e. email vs Email etc.

W
wildwally author 9/7/2010

Found that the email should have been Email, BUT still getting error and not sure what
Error type256Error descriptionYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where Email = 'wally1@ir.com'' at line 1URLlocalhost/Project_VA/register.php?Error fileC:\*\***\***\**\****\output\include\dbconnection.phpError line36SQL queryinsert into _users (Status) values ('Pending') where Email = [email=""]'wallyabc@abc.com'[/email]
EDIT** Sorry didn't see your post....PHPRunner 5.2
And I've tried both the Before registration and after succesful registration

R
rod 9/7/2010



Found that the email should have been Email, BUT still getting error and not sure what
Error type256Error descriptionYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where Email = 'wally1@ir.com'' at line 1URLlocalhost/Project_VA/register.php?Error fileC:\*\***\***\**\****\output\include\dbconnection.phpError line36SQL queryinsert into _users (Status) values ('Pending') where Email = [email=""]'wallyabc@abc.com'[/email]
EDIT** Sorry didn't see your post....PHPRunner 5.2
And I've tried both the Before registration and after succesful registration


You could try entering the "Pending" value on "Global Events" / "Register Page" / "Before Registration" and leaving it off of your registration form.



// Enter registration Pending status for this user

$userdata["Status"]="Pending";
return true;


This way every new user that registers will have this value set.

W
wildwally author 9/8/2010



You could try entering the "Pending" value on "Global Events" / "Register Page" / "Before Registration" and leaving it off of your registration form.



// Enter registration Pending status for this user

$userdata["Status"]="Pending";
return true;


This way every new user that registers will have this value set.


Thanks Rod, that did the trick. I tried something similiar to this without the desired results. Can someone explain the difference between the different $ variables?
I used $Value["Status"]="Pending"; and it didn't work.
why would the $userdata do the trick and not $Value. I've also seen others to use, where does one learn when and when not to use these?
Thanks again Rod, I've been beating my head against the wall with that one for couple days - and knew it was so easy.
I'd also like to make suggestion to the forum admin, on items that were uploaded to the test site and tickets submitted, please go back and post how it was solved. People like me scour the forum looking for parts and pieces to make things work. And when we find a thread that has just what we are looking for it seems like it was solved in private chat, email, or through tickets. Just a suggestion.
Keep up the good work.