Count images in post then add class if just one

Using @pascalvgemert’s suggestion as a starting point, I’m using the following script:

jQuery(document).ready(function() {
    var imgCount = jQuery(".single-post #content-left p a").children("img").length;
    if (imgCount == 1) {
    jQuery("img").addClass("lone-image");
    }
});

Works like a charm.

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