Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/10334-updating-a-mysql-database/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.