This topic is locked

updating current users record on event

2/8/2008 10:25:37 AM
PHPRunner General questions
W
wfcentral author

I've read all through the forum and help files and tried this 20 different ways and I'm just not getting something right.
Hard to explain the situation, but I am changing a user from admin "default" to admin "locked" when they view a certain page...
so, the event on that page load has this code...
so, if they are currently logged in as account_ID #3 and they hit this page then in tbl2008Account it should change from
account_ID 3 - admin level "default" to admin level "locked"
global $conn;

$strUpdate = "update tbl2008Account set admin='locked' where account_ID = 'account_ID'";

db_exec($strUpdate,$conn);

kujox 2/8/2008

I've read all through the forum and help files and tried this 20 different ways and I'm just not getting something right.

Hard to explain the situation, but I am changing a user from admin "default" to admin "locked" when they view a certain page...
so, the event on that page load has this code...
so, if they are currently logged in as account_ID #3 and they hit this page then in tbl2008Account it should change from
account_ID 3 - admin level "default" to admin level "locked"
global $conn;

$strUpdate = "update tbl2008Account set admin='locked' where account_ID = 'account_ID'";

db_exec($strUpdate,$conn);


So do you want to lock their account if they view a certain page or do you want them to view the page only once?

W
wfcentral author 2/8/2008

I want to lock their account if they view a certain page.
The idea is this - they are registering for a golf tournament. They are making mistakes and need to be able to change player name, age, etc before making payment. However, once they click on the paypal button and make payment we don't want them changing their stuff... just to make sure they don't register one kid, make payment then go back and add two more kids in... or register a 7 yr old (lower registration fee) and pay... then come back and change the age to 15 (higher registration fee).
So, I didn't want to mess with all the Paypal IPN stuff since I have not done it... I thought it would be easy to add a new view called checkout and put the paypal button on that page. Warn then that once they enter that page they are done editing... then put in the event code so when they enter that page it changes their account to "locked"
I put code in the security area of PHPrunner so that an account with "locked" cannot edit stuff.
I just cannot figure out how to make it only change the account they are using and not all accounts... can't get my where statement to work...
in simple english it needs to say "update admin="locked" where account_ID = the account ID of the record owner or current logged in account ID
I have two tables...
tbl2008Account (account_ID, name, email, admin)

tbl2008 (player_ID, account_ID, name, age, division, fee, paid)
they are linked on account_ID...
so, a person logs in and creates an account - then they can add one or more players to that account. Each player will be listed under that account_ID.
when they hit the checkout page I need to set tbl2008Account - admin field to "locked" so they can't go back and edit stuff.
Robert



So do you want to lock their account if they view a certain page or do you want them to view the page only once?