Announcement

Collapse
No announcement yet.

deleteing from text table

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    deleteing from text table

    unfortunately, I host my site with Godaddy, so it's stucking alot.


    I'm trying to delete some tags used since vb4, so I'm using this query in phpmyadmin:
    UPDATE `text` SET `rawtext` = REPLACE(`rawtext`, '[color="indigo"]', '') WHERE `rawtext` LIKE '%[color="indigo"]%' COLLATE utf8mb4_bin

    But it couldn't be done as it's alot, and the server stuck for a while.

    Question:
    Can I do it using ssh? if yes then how and how I can delete anything between Brackets ( and starts with and chrachter)

    Regards​

    #2
    How many records to be deleted? You can do it in batches.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #3
      a lot and different ones.

      Comment


        #4
        I'm looking for numbers like thousands or millions to gauge how long would the delete query approximately take
        Helpful? Donate. Thanks!
        Buy me a coffeePayPal QR Code
        Fast VPS Host for vBulletin:
        A2 Hosting & IONOS

        Comment


          #5
          total maybe more than thousand or so.

          Comment


            #6
            The query shouldn't take that long to process if it's just thousands. But you could limit the affected rows to delete in batches. For example:

            DELETE FROM table
            WHERE ...
            LIMIT 100

            Of course, you'll have to backup the database before performing the deletions.
            Helpful? Donate. Thanks!
            Buy me a coffeePayPal QR Code
            Fast VPS Host for vBulletin:
            A2 Hosting & IONOS

            Comment


              #7
              Really I don't know how to do this.

              Comment


                #8
                Sorry, it should be UPDATE and not DELETE. I thought were doing delete. Just add LIMIT to the end of your existing UPDATE query.
                Helpful? Donate. Thanks!
                Buy me a coffeePayPal QR Code
                Fast VPS Host for vBulletin:
                A2 Hosting & IONOS

                Comment


                  #9
                  May I know what the query is exactly?

                  Comment


                    #10
                    Appreciate your help, I followed what you said and it works.

                    Thank you.

                    Comment


                      #11
                      BTW,
                      Pleasee take a look to theses:

                      <table style='filter:shadow'><font color="#3457E4" size="6">
                      <table style='filter:glow'><font color="#3457E4" size="6">
                      <table style='filter:shadow'><font color="#FFFFFF" size="6">
                      <table style='filter:glow'><font color="#FFFFFF" size="6">
                      <table style='filter:glow'><font color="#FFFFFF" size="6">
                      <font color="#3457E4" size="5"><b><marquee direction="right">

                      There're are hundereds of these, How I can run a query for them once?
                      ​

                      Comment


                        #12
                        For <marquee>, just replace it with <div> and the closing tag </marquee> with </div>
                        Code:
                        UPDATE `text` SET `rawtext` = REPLACE(`rawtext`, '<marquee ', '<div '),`rawtext` = REPLACE(`rawtext`, '<\/marquee>', '<\/div>') WHERE `rawtext` LIKE '%<marquee %' LIMIT 1;
                        Limit the query to 1 record first to see if it works. Then increase it after confirming it's working.

                        For <table> with filter and <font>, you can keep them in the database but override the style using the below custom CSS in css_additional.css template:

                        Code:
                        table[style*="filter"] {
                            filter: none;
                        }
                        font {
                            color: inherit;
                            font-size: inherit;
                        }
                        Helpful? Donate. Thanks!
                        Buy me a coffeePayPal QR Code
                        Fast VPS Host for vBulletin:
                        A2 Hosting & IONOS

                        Comment


                          #13
                          Originally posted by glennrocksvb View Post
                          For <marquee>, just replace it with <div> and the closing tag </marquee> with </div>
                          Code:
                          UPDATE `text` SET `rawtext` = REPLACE(`rawtext`, '<marquee ', '<div '),`rawtext` = REPLACE(`rawtext`, '<\/marquee>', '<\/div>') WHERE `rawtext` LIKE '%<marquee %' LIMIT 1;
                          Limit the query to 1 record first to see if it works. Then increase it after confirming it's working.
                          [/code]
                          It didn't delete the word marquess if it comes alone.

                          For <table> with filter and <font>, you can keep them in the database but override the style using the below custom CSS in css_additional.css template:

                          Code:
                          table[style*="filter"] {
                          filter: none;
                          }
                          font {
                          color: inherit;
                          font-size: inherit;
                          }
                          I didn't try it yet, but if I can deleted it, it'll be better.

                          Thank you again

                          Comment


                            #14
                            Originally posted by abd View Post
                            It didn't delete the word marquess if it comes alone.
                            What do you mean "if it comes alone"? Could you give a sample post?

                            Originally posted by abd View Post
                            I didn't try it yet, but if I can deleted it, it'll be better.
                            Using that CSS code is "safer". There is a risk of losing/messing up the parts of a post in deleting those tags in the database. If a post happens to have parts of those text outside of HTML tags, then they will also be inadvertently deleted. Or if, for example, the ending tag </font> was deleted but the opening tag <font> was not, then it may break the layout of the entire page because the end tag was missing and the subsequent HTML tags had become the child tag of the <font> tag.

                            If there was a way to reset the <marquee> tag's scrolling behavior with CSS, I would have also suggested a CSS solution. But it's not possible, that's why I tried posting the SQL solution to replace it with <div> tag.

                            Helpful? Donate. Thanks!
                            Buy me a coffeePayPal QR Code
                            Fast VPS Host for vBulletin:
                            A2 Hosting & IONOS

                            Comment


                              #15
                              Thanks,
                              1- All those tag used in ver 3 and 4( for Arabic use)
                              2- Unfortunately I deleted all (marquee) tags.
                              3- About table, you're right so I deleted </font> and any similar tags like [/color] / [/size]
                              4- the problem was with like these example:
                              A- [FONT="Garamond"] - [FONT="Arial Black"]
                              B- [SIZE="3"] - [SIZE="4"] - [SIZE="6"]
                              C- [COLOR="#40E0D0"]- [COLOR="24433E"]-[COLOR="175928"]

                              And Also
                              <table style='filter:shadow'><font color="#3457E4" size="6">
                              <table style='filter:glow'><font color="#3457E4" size="6">​​

                              So if I can run the Update query for every kind of tag bassed on what between barkets, like [COLOR="#40E0D0"] to be [COLOR="??????"] and so on.

                              Comment

                              Users Viewing This Page

                              Collapse

                              There is 1 user viewing this forum topic.

                              • Guest Guest

                              Latest Posts

                              Collapse

                              Working...
                              X
                              Searching...Please wait.
                              An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

                              Please push the back button and reload the previous window.'
                              An unexpected error was returned: 'Your submission could not be processed because the token has expired.

                              Please push the back button and reload the previous window.'
                              An internal error has occurred and the module cannot be displayed.
                              There are no results that meet this criteria.
                              Search Result for "|||"