I'm pulling my hair out in frustration at this little bit of php code that I thought would work - yet doesn't. It's meant to take an image ("image" datatype) from a MSSQL (not MySQL) database and display it.
Oddly enough when the url of the script is visted the title bar states "JPEG Image, 1024x768 pixels" (Firefox) which is spot on - yet all that appears is a completely blank/white image (1024x768 pixels, but only 4.00 KB in size).
Is there something wrong with the script?
$myServer = "XYZPC\SQLEXPRESS";
$myUser = "sa";
$myPass = "#*$!#*$!X";
$myDB = "YYYYY";
$dbhandle = mssql_connect($myServer, $myUser, $myPass, true) or die("Error1");
$selected = mssql_select_db($myDB, $dbhandle) or die("Error2");
$query = "SELECT image FROM abc WHERE id=999";
$result = mssql_query($query,$dbhandle);
$content=mssql_result($result, 0, "image");