WordPress Drop down category as array for using in page builder

You are partially correct , you are not passing cat id in your parameter. Try

$categories_array[ $category->term_id ] = $category->name;

Now you will get category id as drop down value.

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