Display post x of y within category

Raw SQL is inconvenient.

You can use get_posts() (or WP_Query which it wraps) with 'fields' => 'ids' (see fields parameter ) for lightweight counting, while retaining compatibility with all arguments it accepts, including category parameters

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