+ Post New Thread
Results 1 to 2 of 2

Thread: Query to Replace text with quotation marks in whole mysql database

  1. #1
    Fli
    Fli is online now
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,458

    Query to Replace text with quotation marks in whole mysql database



    Hi, i would like to replace

    [quote name='varioususernamesthere']

    by

    [quote name="varioususernamesthere"]

    (single to double quotation marks)

    in whole mysql database table.

    Please what is the command to use?

    Something like? UPDATE tablename SET "%
    [quote name="varioususernamesthere"]%" WHERE "%[quote name='varioususernamesthere']%";

  2. #2
    Fli
    Fli is online now
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,458


    Is this useful / helpfull? Yes | No
    Here is how to replace string in mysql with quotation marks single and double. This command will replace partial string '] by "] in table TableName and column name ColumnName

    update TableName set ColumnName = REPLACE(ColumnName, "']", '"]') WHERE ColumnName LIKE "%']%";

    (Make sure you backup mysql first before runing this query)

    This one may work if table is "post", in column "pagetext".:
    update post set pagetext = REPLACE(pagetext, "']", '"]') WHERE pagetext LIKE "%']%";

+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 08-05-2016, 10:56 AM
  2. Replies: 0
    Last Post: 03-02-2015, 01:01 PM
  3. Too many conditions in mysql query - is efficient?
    By Fli in forum HTML,CSS, Javascript Coding & Programming
    Replies: 0
    Last Post: 09-22-2013, 05:16 PM
  4. How to make mysql query search case insensitive?
    By Fli in forum PHP, MySQL Forum
    Replies: 0
    Last Post: 09-22-2013, 04:08 PM
  5. Replies: 0
    Last Post: 03-24-2013, 01:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam