I upload some images into upload dir. Then i need to insert them as attachments. I use wp_insert_attachment, wp_generate_attachment_metadata, wp_update_attachment_metadata for this. As a result i have original images, resized images and db data in wp_posts and wp_postmeta. My data in wp_posts is correct, like i did this with default downloader. I'm not sure that my data in wp_postsmeta is correct, but i have there some results which have url to the original image and name of resized image.
All i need - to print my results with 'default' 'foreach ($attachments as $attachment)' and 'wp_get_attachment_image_src($attachment->ID, 'medium')' for example.