SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2004
    Location
    UK
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Updating data on mysql using PHPmyadmin problems

    Hi

    I have a problem, after moving hosts my database for some reason failed to backup correctly

    I have two columns lets call them col_b and col_c showing data of 0 in about 30% of the entries when they should be 1

    These should be a value of 1 if col_a is also 1

    what UPDATE command can i use in PHPmyadmin to change the entries in col_b and col_c if the value of col_a is 1?

    Thanks John

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,399
    Mentioned
    147 Post(s)
    Tagged
    4 Thread(s)
    Code:
    UPDATE tablename
    SET column_b = 1
    WHERE column_a = 1
    AND   column_b = 0
    Then repeat for column_c

  3. #3
    SitePoint Member
    Join Date
    Feb 2004
    Location
    UK
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you


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
  •