Results 1 to 2 of 2

Thread: Help with SQL UPDATE

  1. #1
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default Help with SQL UPDATE

    I need help with updating multiple rows in a table if the email address equals 'this e-mail' or 'that e-mail'

    What I have for one query:

    Code:
    UPDATE `email_table` SET `email_status` = "0" WHERE `email_address` = "user@domainname.com"
    I tried OR but it updated the whole table. I can't seem to type in the right search terms to find an answer.

    As always, thanks in advance!
    Thank you,
    Lynne Hanson
    RL Hanson-Online

  2. #2
    rlhanson's Avatar
    rlhanson is offline Master Glow Jedi
    Join Date
    Aug 2007
    Location
    Chapman, Kansas
    Posts
    531

    Default

    Here's the correct syntax - finally figured it out!

    Code:
    UPDATE `email_table` SET `email_status` = "0" WHERE `email_address` = "user@domainname.com" OR `email_address` = "anotheruser@domainname.com"
    Thank you,
    Lynne Hanson
    RL Hanson-Online

Similar Threads

  1. ImageMagick update
    By Michelle in forum General Support
    Replies: 1
    Last Post: 10-19-2008, 11:55 AM
  2. SQL Again!
    By andychev in forum Programming Talk
    Replies: 13
    Last Post: 02-07-2007, 11:36 AM
  3. SQL Nightmare
    By andychev in forum Programming Talk
    Replies: 2
    Last Post: 05-23-2006, 03:02 AM
  4. Security Update:
    By Matt in forum Outages and Scheduled Maintenance
    Replies: 0
    Last Post: 01-22-2005, 02:42 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16