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 there a way to chain multiple tailwind css classes on a single hover instance?

 https://stackoverflow.com/questions/73524088/is-there-a-way-to-chain-multiple-tailwind-css-classes-on-a-single-hover-instance There is a wa...