How to query for backslashes in an SQL Database

Discussion in 'MySQL' started by sixty6, Aug 8, 2008.

  1. #1
    I am trying to run the following command in phpMyAdmin:
    update table_name set category_name = replace(category_name, ‘//’, ‘/’)
    Code (markup):
    This query was so I could remove double-backslashes, but I am getting the following error:
    and here is what MySQL said:
    I searched the internet and couldn't find anything that could help me, if anyone knows what I should replace the backslashes with, please let me know!
     
    sixty6, Aug 8, 2008 IP
  2. awatson

    awatson Active Member

    Messages:
    112
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    awatson, Aug 8, 2008 IP
  3. Rory M

    Rory M Peon

    Messages:
    1,020
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you're trying to output through PHP you could use

    
    stripslashes($string);
    
    PHP:
     
    Rory M, Aug 8, 2008 IP
  4. sixty6

    sixty6 Well-Known Member

    Messages:
    1,748
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    190
    #4
    Sorry, I meant to say forward slashes (I just gave it the wrong title). And I don't think I need to escape it, I just need a different syntax for forward slashes (from my understanding).

    I wasn't trying to create a PHP output, I was trying to run an SQL command to remove double forward slashes in a certain category.
     
    sixty6, Aug 8, 2008 IP