MySQL: Update If exist

Source: https://stackoverflow.com/questions/46628616/ignore-update-data-if-exist-in-mysql-by-node-js

https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

Fixed it by :
ON DUPLICATE KEY UPDATE

connection.connect( function( err ) {

    connection.query( "INSERT INTO real_user SET ? ON DUPLICATE KEY UPDATE updated_at = '" + data.created_at
     + "', request_count = '" + data.request_count + "'", 
        data,  function( err, res ) {
            connection.end();
        });

    });

Không có nhận xét nào:

Is it okay to use both fetchpriority="high" and loading="eager" in img tag?

 https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...