Limit image upload to 10

here you go:

get_posts(array('post_type'=>'attachment', 'numberposts' => 10, 'post_parent' => $post_id));

this will return you upto 10 posts.

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