WordPress Custom Query: Combining Two Functions

You should probably be using the WP_Query object and have it order your posts by a meta field:

http://codex.wordpress.org/Function_Reference/WP_Query#Parameters

Doing so will handle sorting and pagination out of the box.

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