“Insert Into Post” For Custom Button

Got this working using window.parent.send_to_editor

function wcmediaInsert()
{
window.parent.send_to_editor('<?php echo wp_get_attachment_image($attachment->ID, 'large', false, $attr); ?>');
window.parent.tb_remove();
}

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