Naprawdę wolę następującą strukturę kodu. Nawiasem mówiąc, w swoim kodzie nie wskazałeś, jaka jest kolumna dla adresu URL obrazu, więc założę w poniższym fragmencie kodu, że to jest:Image_URL
Proszę zwrócić uwagę na zastosowanie metody $wpdb->prepare do oczyszczenia parametrów zapytania. I zwróć uwagę na metodę esc_attr w tagu obrazu.
[insert_php]
global $wpdb;
$pr = get_the_title();
$results = $wpdb->get_results($wpdb->prepare("SELECT * from print_drug where Product_Name = %s", $pr));
foreach ($results as $obj) {
echo "<em><strong>Product Name:</strong></em> {$obj->Product_Name}<br>
<em><strong>Active Substance:</strong></em> {$obj->Active_Substance}<br>
<em><strong>Substance Sorting Identification Number:</strong></em> {$obj->Substance_Sorting_Identification_Number}<br>
<em><strong>Production Form of Use:</strong></em> {$obj->Production_Form_of_Use}<br>
<em><strong>Chemical Formation:</strong></em> {$obj->Chemical_Formation}<br>
<em><strong>Dosages of Use:</strong></em> {$obj->Dosages_of_Use}<br>
<em><strong>Approval Agency:</strong></em> {$obj->Approval_Agency}<br>
<em><strong>Year of Approval:</strong></em> {$obj->Year_of_Approval}<br>
<em><strong>Approval Assigned Company:</strong></em> {$obj->Approval_Assigned_Company}<br>
<em><strong>Approval Country:</strong></em> {$obj->Approval_Country}<br>
<em><strong>Prohibited Cases:</strong></em> {$obj->Prohibited_Cases}<br>
<image src='".esc_attr($obj->Image_URL)."'>";
}
[/insert_php]