In which database table and column do I need to insert an image path, in order to display product images in wp-admin (not on the front end)? I insert products by query in WordPress, rather than insert products by admin.
$insert = $wpdb->insert( $prefix."posts", array(
"post_title" => $posTitle,
"post_content" => $postContent,
"post_status" => "publish",
"post_type" => "product"
) );
// select products ID
$select = $wpdb->get_results( "SELECT ID AS productsId
FROM " . $prefix . "posts
WHERE post_title='" . $posTitle . "'" );
// echo $select[0]->productsId; die();
// insert umage in posts and product attribute meta posts table
$insertImg = $wpdb->insert( $prefix . "posts", array(
"post_status" => "inherit",
"post_type" => "attachment",
"guid" => $postGuid,
"post_parent" => $select[0]->productsId
) );