संभावना है कि आपका displayWinesList() . है इसे वापस करने के बजाय इको के डेटा को फंक्शन करें।
आप या तो डेटा को वापस करने के लिए अपने फ़ंक्शन को संशोधित कर सकते हैं या इसे वैसे ही छोड़ सकते हैं और डेटा को कैप्चर करने के लिए आउटपुट बफरिंग का उपयोग कर सकते हैं:
$to = "example@sqldat.com";
$subject = "WineStore Query";
ob_start();
displayWinesList($connection, $query,$region_name, $wine_type, $price);
$message = ob_get_clean();
$message = '<html>'.$message.'</html>';
$from = "example@sqldat.com";
…
हालांकि निश्चित रूप से जानने के लिए कृपया अपनी displayWinesList() post पोस्ट करें समारोह।