How to detect if this post is a woocommerce product?

You can Use Condition for check product or post

if(is_product() && get_the_id() == 243) {
    //do stuff
}else{
    //do stuff
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)