Jump to content

Use PHP to Reset one field to default value in every row


woocha

Recommended Posts

Hey Guys,

 

    I am not sure if this is possible or not, but am trying to update my MySQL db so that every row of one field is restored to its default vaue.  If this is not possible, I would like to set the fields equal to a value. 

 

  has anyone done this before, or does anyone know how to do this?

 

Thanks guys

Link to comment
Share on other sites

I want to query my db table that has 325 rows of data.  thats 325 users.  Each users 'members' level is defaulted to 3 and some of them have changed.  I wand to know if it is possible to update all 325 users to the default number 3 using a php script

Link to comment
Share on other sites

When I said x=y, it meant any possible conditional that would specify which rows get updated. Like "WHERE user_id = 5" or "WHERE user_fname='Bob' " or whatever. But if you leave out the WHERE part, it will update every single row with the stuff after SET

Link to comment
Share on other sites

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.