A Forum reader recently asked:
"We have a Security System with a SQL database that holds our employee pictures as BLOB objects. Is it possible to link to these from the User App?"
And here is the response from Cathy Leik ...
Thanks to the guys I work with - they wrote a PHP script to allow us to have the User App query the SQL Database directly. The script looks like this:
// Change the myServer, myUser, myPass, and myDB variables below to match
// your environment
// the "pic" variable in this case happens to be the workforceID, this is
// unique identifier we are using to match employees
// This script will return the image; modifications may need to be made to
the php.ini file
// on the server to handle over 4096 bytes
// In our case, we are using MS SQL, increased both the mssql.textlimit
$pic = $_GET['pic'];
$myServer = "ServerName";
$myUser = "DBUser";
$myPass = "DBUserPassword";
$myDB = "DBName";
$dbhandle = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't
connect to SQL Server on $myServer");
$selectdb = mssql_select_db($myDB, $dbhandle) or die("Couldn't open
// Query the database for the picture - Personnel.text1 contains the
// The picture is stored in the Images table, there is a relationship
between Personnel.objectID and Images.ParentID
$querydb = "select Image from Images INNER JOIN Personnel on
Personnel.objectID = Images.ParentID WHERE Personnel.text1 = $pic";
$result = mssql_query( $querydb );
for ($i = 0; $i < mssql_num_rows( $result ); ++$i)
$line = mssql_fetch_row($result);
In UserApp, modify the portlet HTML layouts to use the following:
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.