Saving category as insert post

The array for post_category needs to be an array of integers, not a string, and that’s what you are getting from the $_POST[‘cat’] the way you have it written. Change the value in the option to the category id instead.

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