Hi Ive got a few sql functions
Code:
CREATE FUNCTION getItemsFromAccount( @accountName varchar(300) )
RETURNS varbINARY(1920)
BEGIN

declare @BinaryVariable2 varbINARY(1920)
set @BinaryVariable2 = (select items from warehouse where AccountId=@accountName);
return @BinaryVariable2

END
Code:
CREATE FUNCTION getItemsFromCharIndex( @hexItemCode varbinary(20) )
RETURNS varbINARY(1920)
BEGIN

declare @BinaryVariable2 varbinary(1920);
set @BinaryVariable2 = (select items from warehouse where (charindex @hexItemCode, Items) %16=4));
return @BinaryVariable2 ;
END
The first function is working as expected when i call it using
Code:
$ci = $db->Execute("SELECT [dbName].[dbo].[getItemsFromAccount]('TestUser');");
$ci = $res->fetchrow();
I recieve the full varbinary result

The second function called using
Code:
$ci = $db->Execute("SELECT [dbName].[dbo].[getItemsFromCharIndex](0x00C93119)");
$ci = $res->fetchrow();
I receive only a partial result
Ive tested this via the sql query analyzer and it returns the partial result there as well

Does anyone know a way to fix my sql function to make it return the entire varbinary result

testing the result in query analyzer using print(@varible) produces the correct results
ie
Code:
declare @result varbinary(1920);
set @result = (SELECT [MuOnline].[dbo].[getItemsFromCharIndex](0x00C93119));
print @result;
returns the correct results but i cant access the print value from outside the query analyzer

Thx for helping