Alternative loop syntax error [closed]

Because you’re using semicolons when you should be using colons after the if and the while 🙂

query_posts( 'year=2011' );
if ( have_posts() ):
    while ( have_posts() ):
        the_post();
        the_title();
    endwhile;
    wp_reset_query();
endif;

That works just fine.

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