Does anyone know how to display an image from a field in a PostgreSQL database table?
Here is what I am working with so far...
<?
$connect = pg_connect(<myconnect string>);
$Query = "SELECT * FROM MyTable WHERE id = 1";
$Result = pg_exec($connect, $Query);
$Row = pg_fetch_row($Result, $Row);
$Object = pg_locreate($connect);
$File = pg_loopen($connect, $Object, "r"
pg_loreadall($File); // should dump pic to browser.
?>
Look at the above code, I can obviously see some potential problems with it, but I am still researching this. If you already have sample code that could demonstrate what I am trying to accomplish, that would be most helpful.
The data-type I am using for this is "bytea", which ironically, is not listed when I create the field.
The image type is a JPG image.
Gary
gwinn7
Here is what I am working with so far...
<?
$connect = pg_connect(<myconnect string>);
$Query = "SELECT * FROM MyTable WHERE id = 1";
$Result = pg_exec($connect, $Query);
$Row = pg_fetch_row($Result, $Row);
$Object = pg_locreate($connect);
$File = pg_loopen($connect, $Object, "r"
pg_loreadall($File); // should dump pic to browser.
?>
Look at the above code, I can obviously see some potential problems with it, but I am still researching this. If you already have sample code that could demonstrate what I am trying to accomplish, that would be most helpful.
The data-type I am using for this is "bytea", which ironically, is not listed when I create the field.
The image type is a JPG image.
Gary
gwinn7