Ecommerce Shopify WordPress Discussion

Show sql datatype image in php

I have the flowing sql query the MainImage datatype is image (think binary) SELECT dbo.tbl.strPartNumber AS SKU, dbo.tbl.strDesc AS ProductName, dbo.tbl.strExtendedDesc AS ShortDesc, (SELECT TOP 1 dbo.tblImg.imgData FROM dbo.tblImg WHERE dbo.tblImg.strpartnumber = dbo.tbl.strpartnumber AND bitDefaultImage = '1') as MainImage, dbo.tbl.bitInactive AS Inactive FROM dbo.tbl WHERE bitWebstoreItem = '1' now I can get all data to show but not the image this what I have for the img show what I would like to do is select image from outside datasource and add it to new or existing product in woocommerce $DefaultImage = base64_encode($row["MainImage"]); if (isset($DefaultImage) && $DefaultImage !== null) { echo '<td align="center" style="border-color:#000000"><img src="data:image/jpeg;base64,' . $DefaultImage . '" width="150" height="150"></td>'; } else { echo "<td align=\"center\" style=\"border-color:#000000\">No image available.</td>"; } it only shows a broken image I have search the forum and no solution is found yet I have done a var_dump and get string(0) I read the following https://stackoverflow.com/questions/10958350/display-image-in-php-page-from-sql-database but this is for only the images. also this https://stackoverflow.com/questions/55785364/update-image-in-php-and-mysql-database EDIT SCREENSHOT OF DATA enter image description here
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.