Rachman
September 20, 2023, 7:56am
1
I’d like to ask,
I created a custom file and want to load the blob image in the html
but the result is: ���� JFIF ``���1�=��� xxxthe code I made is like this:
<?php
$query = "SELECT * FROM employee";
$stmt = ExecuteQuery($query);
$display = "";
if ($stmt->rowCount() > 0) {
while ($row = $stmt->fetch()) {
$display .= $row["logo"]." <br>";
}
//var_dump($display);
echo '<img src="data:image/jpeg;base64,'.base64_encode($display->load()) .'" />';
} else {
echo " ";
}
?>
Thank You
Rachman
September 21, 2023, 12:13am
3
thank you, very helpful. it works
Rachman
September 21, 2023, 1:07am
4
I want to ask again,
I want to try to display a blob image in the listpage header using the page_dataRendering event, how to insert the PHP code, for example:Event Page_DataRendering :
//Example
$get_blob = ExecuteScalar("SELECT pic FROM employees");
<?php
echo "test"; error output
?>
$headers = "
<!--sample blob-->
<div class='fadeIn animated mb-4'>
<div class='text-capitalize text-center'>
<img class='img-responsive' src='data:image/jpeg;base64,'.base64_encode($get_blob) .' ' width='200' height='150'>
<h2>BLOB File</h2>
</div>
</div>
";
mobhar
September 21, 2023, 1:09am
5
There is no need to include php tags inside server event, since it is already PHP code.
arbei
September 21, 2023, 6:19am
6
Rachman wrote:
$headers = "
BLOB File
";
You have wrong syntax. You cannot use the “.” to concat string inside a double quoted string like that. You may read PHP Strings and learn.
Rachman
September 27, 2023, 8:30am
7
Thank You,
the code is running smoothlyecho ‘ ’;