Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:27:21+00:00 2026-06-16T01:27:21+00:00

I am planning to use PHP to execute an SQL case statement to edit

  • 0

I am planning to use PHP to execute an SQL case statement to edit many rows at once in a MySQL table. If the query fails, is it possible that some values will have changed while others haven’t?

This example shows the kind of case statement involved:

UPDATE person
    SET name = CASE id
        WHEN 1 THEN 'Jim'
        WHEN 2 THEN 'Mike'
        WHEN 3 THEN 'Precious'
    END,
    sex = CASE id
        WHEN 1 THEN 'female'
        WHEN 2 THEN 'male'
        WHEN 3 THEN 'male'
    END
WHERE id IN (1,2,3)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:27:24+00:00Added an answer on June 16, 2026 at 1:27 am

    Transactions is the word you’re looking for. A transaction is an all or nothing operation. This means that either everything passes and the transaction is done, or something fails and the whole transaction is rolled back. This way you prevent inconsistencies in your data.

    As mentioned above, your table engine needs to support transactions. InnoDB does this in MySQL, while MyISAM doesn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am planning to use PIC18F6*** serial microntroller for my project serial-ethernet converter. Once
I'm working on php, mysql on a project I'm planning to add a multilanguage
I've built a PHP based website with MySQL as the back-end, and am planning
I am planning to use PHP's autoload function to dynamicly load only class files
I'm planning to use PHP for a simple requirement. I need to download a
I already am planning to use php to access the actual database then post
I am planning to use php in an embedded environment. Our current web server
How secure are php Sessions? I am planning to use the native PHP sessions
I'm planning to use SOLR for full-text search. Question: when I update my MySQL-database,
Am planning to use cookies to communicate between two browser windows. Am wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.