0

Can any one help me and tell me what am I doing wrong here, I can't seem to figure out why cant I get the signature on html page Here is the code I am working with....

<?php
include('config.php');


$sql = "SELECT signature FROM details WHERE id = ?";
$stmt = $pdo->prepare($sql);

$id = "116"; // Replace with the ID of the signature data to retrieve
$stmt->bindParam(1, $id, PDO::PARAM_INT);

$stmt->execute();

// Fetch the result and return the base64-encoded signature data
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if ($result) {
    $signatureData = $result['signature'];
    $base64Data = base64_encode($signatureData);
    $img = '<img src="data:image/png;base64,'>';
    echo $img;

  } else {
    echo "No signature data found for ID $id";
  }
  ?>

I am trying to display signature on html form which is in the database

0 Answers0