SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mysql: How to update value in 27000 rows?

    Hello,

    some member created 27000 posts in wrong section (lol ) so i need to edit all his entries to get new section ID.

    SELECT * FROM `phpbb_topics` WHERE `topic_first_poster_name` LIKE "%ozerway%";

    this will select all his topics...

    the column with forum id is named "forum_id" and wrong value is 4, correct value should be 5

    please kindly how the command should look like to update all these mysql rows forum_id from 4 to 5?

    Thank you

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,263
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Code:
    UPDATE phpbb_topics 
       SET forum_id = 5
     WHERE topic_first_poster_name LIKE '%ozerway%'
       AND forum_id = 4
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •