SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Need help with a query

    Every registered user on my website has a uID, like 110 for example. They can also have a distributor number that is stored in the database, like 1201186 for example. Until our website switched over to using referral addresses with the person's distributor number, we were using the uID in the refer URL, like this:

    Aromatherapy & Essential Oil Testimonials

    Over time we realized that we really should be using the person's distributor ID, instead, like this:

    Aromatherapy & Essential Oil Testimonials

    So when people register on our website, because they clicked on a referURL somewhere on the web, the database sometimes shows the referring distributor as 110, the uID or sometimes as 1201186, the actual distributor number.

    It's time to clean up the database, if possible, now that we have been using the new method for some time of just the person's distributor ID in the referURL.

    I need come up with a query that will look in the user database and find everyone where a distributor ID was recorded and replace it with that distributor's uID.

    Does this make sense? Is this even possible?

    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    without seeing your table layout we'd have no idea on how to construct the query. shouldn't be a problem with that info.

  3. #3
    SitePoint Evangelist speda1's Avatar
    Join Date
    Jan 2002
    Posts
    550
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    update table_name set id = distributor_id


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •