Jump to content


Photo

Updating A MySql Database


  • Please log in to reply
1 reply to this topic

#1 Drezard

Drezard
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts

Posted 24 May 2006 - 09:09 AM

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

#2 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 24 May 2006 - 12:56 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users