Results 1 to 3 of 3

Thread: Question

  1. #1
    Join Date
    Mar 2012
    Posts
    8

    Unanswered: Question

    Hello all :-)

    I have a small question:

    Lets say that we have a table that contains the following :

    Example:

    PHP Code:
    Users        Name    Password  

    usr   01      name1   
    *****
    usr   02      name2   *****
    usr   03      name3   *****
    user  04      name4   ***** 
    So, how can i change / alter the contains of column "Users"

    so that the Users that are typed as 'usr **' (where ** = number) to become user ** ?

    This is what i want to achive:


    PHP Code:
    Users         

    user 01     
    user 02     
    user 03     
    user 04 

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    UPDATE daTable
       SET users = REPLACE(users,'usr','user')
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2012
    Posts
    8
    Quote Originally Posted by r937 View Post
    Code:
    UPDATE daTable
       SET users = REPLACE(users,'usr','user')
    thanks pal, you make it look so easy!

Posting Permissions

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