viralpatel.info
News: www.viralpatel.info >> blog <new> !
Blog


Twitt this! Email this!
8 Things Every Person Should Do Before 8 A.M.
1. Get A Healthy 7+ Hours of Sleep
2. Prayer and Meditation to Facilitate Clarity and Abundance
3. Hard Physical Activity
4. Consume 30 Grams of Protein
5. Take A Cold Shower
6. Listen to/Read Uplifting Content
7. Review Your Life Vision
8. Do At Least One Thing Towards Long-Term Goals

By Benjamin P. Hardy

Source : https://medium.com/@benjaminhardy/8-things-every-person-should-do-before-8-a-m-6d30b3af732e








Twitt this! Email this!
I came across HTTP 406 error for the first time, when I named my previous article as \"replace-into-vs-insert-into-on-duplicate-key-update-mysql\"


406 Not Acceptable

An appropriate representation of the requested resource /articles/article/replace-into-vs-insert-into-on-duplicate-key-update-mysql could not be found on this server.

Interestingly, after a lot of (trial-and-error), I found that the word "insert" was the culprit !

When I removed "insert" from the URL seemed to redirect perfectly !

Still do not know the exact issue but will update here once I get to the root of the problem.

Edit 1: Intrestingly, this article with word "insert" in it did not raised 406 Error !

Edit 2: The problem was that my hosting provider had blocked the URL with "insert-into" in URL !
I got the URL whitelisted and mysql-difference-between-replace-into-insert-into-on-duplicate-key-update is resolving fine.








Twitt this! Email this!

REPLACE INTO and INSERT INTO ... ON DUPLICATE KEY UPDATE


----------------------------------
- Similarity:
-* Both INSERT a row into a database table if PRIMARY KEY or UNIQUE field specified in the SQL, is not present in table.
- Difference:
- If PRIMARY KEY or UNIQUE field specified in the SQL, is already present in table,
-* REPLACE INTO
-** DELETEs the row from the table and then INSERTs a new row with data specified in REPLACE SQL.
-** primary key / uniqe field value is updated.
-** 2 SQL operations are performed.
-** For REPLACE SQL, you need DELETE and INSERT privileges.
-** Data values not present in REPLACE SQL will be set to their default values & older values of the row ( if any ) will be lost.

-* INSERT INTO ... ON DUPLICATE KEY UPDATE
-** UPDATEs the row with data specified in INSERT INTO ... ON DUPLICATE KEY UPDATE SQL.
-** primary key / uniqe field value is updated.
-** Only 1 SQL operation is performed.

source : Impacts of REPLACE INTO