Delete custom fields when deleting posts

The best way to do this is to use the wp_delete_post function as follows:

wp_delete_post($post_id, true); //false (default) sends it to the trash

This function accounts for comments, term_relationships, posts.post_parent, and postmeta.

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