Blob bytea datatype column
Blob bytea datatype column
Hello everybody
How can i use a bytea datatype column from my data base in a datatable or in the editor for generating a pict in the html.
What the php look like and how can i convert the data in json. The conversion must be in the php or in a specific postgresql query?
Thanks for your help.
Lionel
Answers
I presume that bytea is an image? If so, I would suggest rendering an
img
tag into your DataTable with an address such assrc="/image.php?id="
(obviously adding in the image id).Then read the byte array from the db and use the PHP image functions such as
createimage
. It means you have a request and query per image.Your only other option would be to base64 encode the images into the HTML file - but that could end up being massive.
Allan