How in insert image path in Wordpress database that will display product image in wp admin not on front end?

admin

Administrator
Staff member
<pre class="lang-php prettyprint-override">
Code:
$insert = $wpdb-&gt;insert( $prefix."posts", array("post_title" =&gt; $posTitle,"post_content" =&gt; $postContent,"post_status" =&gt; "publish","post_type" =&gt;"product"));

// select products ID
$select = $wpdb-&gt;get_results("SELECT ID AS productsId FROM ".$prefix."posts WHERE post_title='".$posTitle."'");
//echo $select[0]-&gt;productsId; die();
// insert Image in pots and product attribute meta posts table
$insertImg = $wpdb-&gt;insert($prefix."posts",array("post_status" =&gt;"inherit","post_type" =&gt; "attachment","guid" =&gt; $postGuid,"post_parent" =&gt; $select[0]-&gt;productsId ));

I need a small, which table and column I need to insert to display product image in wordpress admin, I insert products by query in wordpress rather than insert product by admin.