<?php
$link = ingres_connect("demodb");
//Open a photo
$fh = fopen("photo.jpg","r");
$blob_data = stream_get_contents($fh);
fclose($fh);
//Prepare parameters
$params[] = $blob_data;
$params[] = 1201;
//Define parameter types
$param_types = "Bi";
$query = "update user_profile set up_image = ? where up_id = ?";
$result = ingres_query($link, $query , $params, $param_types);
if (ingres_errno())
{
echo ingres_errno() . "-" . ingres_error() . "\n";
}
ingres_commit($link);
ingres_close($link);
?>