Background-image from database

OnScriptInit:

The following code is get image from a file system:

?>

html{ background-color: rgb(236, 239, 242); background-image: url("../_lib/libraries/sys/img/image.jpg"); background-repeat: no-repeat; background-size: cover }

Now from database, the field image is blob and loaded from image (database)

$sql_search= “select image from table where id=1”;
sc_lookup(ds, $sql_search);
$blob={ds[0][0]};

$back = “data:image/png;base64,”.base64_encode($blob);

?>

html{ background-image: url("<?php echo $back; ?>"); background-repeat: no-repeat; background-size: cover ; } <?php