Announcement

Collapse
No announcement yet.

Mass remove user profile field data...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mass remove user profile field data...

    I'm working improving the location user field by making it two fields. Field2 (default location field) will be renamed to CITY and I'll be making another field for STATE as a drop down menu.

    However currently we've got members using the old location (field2) the old way, where they've got CITY, STATE. How can I mass remove the data stored for field2? I don't want to delete field2, I just want the info gone so members can input the data the new way.

    How can I do this?


    Thanks,

    -Michael
    Debt-Made-Easy.com: Get out and stay out of debt.

  • #2
    Run this query (backup first):

    Code:
    UPDATE userfield
    SET field2 = ''
    This will delete the contents of that field for all users.

    Comment


    • #3
      Jake,

      That query worked perfectly!


      However I've got another question, I've used this query for Field10 as well which is my STATE field. When I created field10 (ST) I set it up as a single-selection menu, from there I've entered all 50 states - one per each line and have made the field searchable, and to be shown on the members list.

      What I'm trying to do is so when someone looks at a members profile and that member has in his profile say AZ for his state - the viewing member can click on AZ and it will show all the members that also have AZ for Field10. I can get this to work with Field2, just not Field10.

      Here is the code I'm using

      Code:
      <if condition="$userinfo['field2']"><strong>Hometown:</strong> <a href="memberlist.php?do=getall&amp;field2=$userinfo[field2]" title="Search for members in $userinfo[field2]">$userinfo[field2]</a></if><if condition="$userinfo['field10']">, <a href="memberlist.php?do=getall&amp;field10=$userinfo[field10]" title="Search for members in $userinfo[field10]">$userinfo[field10]</a></if><br />
      


      Any idea why Field2 (CITY) works perfectly, but Field10 (ST) does not?


      -Michael
      Debt-Made-Easy.com: Get out and stay out of debt.

      Comment


      • #4
        In the URL you have to specify the option number for the single-selection menu. The first option is 1, the second is 2, the third is 3, etc. For example:

        memberlist.php?do=getall&field2=2

        ...will search for those with the second option enabled. You will have to map the options to numbers somehow.

        Comment


        • #5
          Jake,

          Thanks for your input, I've gone ahead and just made the State field and single line text box and limited the data to two characters and now it's working great.


          -Michael
          Debt-Made-Easy.com: Get out and stay out of debt.

          Comment


          • #6
            I made a thread about this:

            http://www.vbulletin.com/forum/showthread.php?t=169266

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X