get recent 12 days post then random in wordpress

If you are trying to alter your main query have a look at query_posts().

You should be able to achive all you need using query parameters without writing custom queries: WP_Query->orderby & WP_Query->date_query.

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