SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: unwanted characters, how to remove this?

  1. #1
    SitePoint Guru solidcodes's Avatar
    Join Date
    Jul 2006
    Posts
    613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow unwanted characters, how to remove this?

    hi guys

    when i save the email address the value looks like this below,

    anna_single16%40yahoo.com

    it suppose to be anna_single@yahoo.com

    Now how to i remove those nasty characters?

    thank you very much in advance.

  2. #2
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,463
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)
    Code:
    UPDATE daTable
       SET email = REPLACE(email,'%40','@')
     WHERE POSITION('%' IN email) > 0
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Guru solidcodes's Avatar
    Join Date
    Jul 2006
    Posts
    613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks 4937

    But how about in INSERT?

  4. #4
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,463
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)
    if it is getting converted during insert, it is not mysql's fault

    what language are you using? php? that'll be where the problem is
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Guru solidcodes's Avatar
    Join Date
    Jul 2006
    Posts
    613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah php

    so what the command in php to clean that?

    thank you.

  6. #6
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,463
    Mentioned
    35 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by solidcodes View Post
    so what the command in php to clean that?
    no idea, sorry, i don't do php
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as i know is INSERT mean fill in a new data into db....
    if want to clear the whole row in sql,you need to used DELETE..

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
  •