Drezard Posted May 24, 2006 Share Posted May 24, 2006 Hello. What I want to be able to do is.... I have a script that creates a username into the database, I have a second script that updates the script by adding a Nickname and other attributes. I have a third script that the user can change their password.I only want the User to be able to create there Nickname and other attributes once. So with my Second script i only want it to be able to update an account once. But i want the third script to be able to edit the account as many times as the user wants. Please Help. Please Help me. Thanks, Daniel Quote Link to comment https://forums.phpfreaks.com/topic/10334-updating-a-mysql-database/ Share on other sites More sharing options...
freakus_maximus Posted May 24, 2006 Share Posted May 24, 2006 Add a column to your table that stores the nickname called 'locked'.With your user account script, update the 'locked' field to '0'. Which would mean it is not locked.With your 2nd script, that allows them to do one update, have the 'locked' field set to '1' when they do their first and only update. Which would mean it is locked.You would also need to add to your 2nd script a check before the update. You could use an IF or CASE statement to check if 'locked' = '0' then do the update, if 'locked' = '1' then do not do the update. Quote Link to comment https://forums.phpfreaks.com/topic/10334-updating-a-mysql-database/#findComment-38540 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.