Mysql updating multiple tables Chatting online without login sexy girls
It’s very easy to do that, but the challenge lies in updating the database.
Here’s where the multiple updates in a single query trick comes into play.
You can just create a long query to update the database and run it only once instead of hundreds of small queries (which in case you didn’t figure it out, would bring your database to its knees in many cases).
If you omit the WHERE clause, all records in the table will be updated!
For INSERT and UPDATE, the values are the newly inserted/updated values.
The ELSE title is very important, otherwise you will overwrite the rest of the table with NULL.
A naive approach, via PHP, would be to loop over the data to be inserted, inserting one row at a time.
Multiple row operations are in common use in a normalized application databases as one database entity is often linked to multiple sub-entities (for example a user and his tags).
First table ("names") Well, there is an immediate advantage in performing just a single SQL query instead of two, and I believe it is quite clear: the server will have a lighter work load.